Skip to content

Commit

Permalink
improve clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
lofcz committed Jan 8, 2025
1 parent 2041a22 commit 64de6a6
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class ArraysSpec
public class ArrayTests
{
[Test]
public void IntArray_Should_Be_Cloned()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class LoopCheckSpec
public class CircularTests
{
public class C1
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class CopyToObjectSpec
public class CopyToObjectTests
{
[Test]
public void InterfaceTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class ConstructorsSpec
public class CtorTests
{
public class T1
{
Expand Down
6 changes: 6 additions & 0 deletions FastCloner.Tests/DbTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace FastCloner.Tests;

public class DbTests
{

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class GenericsSpec
public class GenericTests
{
[Test]
public void Tuple_Should_Be_Cloned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class InheritanceSpec
public class InheritanceTests
{
public class C1 : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class SimpleObjectSpec
public class ObjectTests
{
[Test]
public void SimpleObject_Should_Be_Cloned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class ShallowClonerSpec
public class ShallowCloneTests
{
[Test]
public void SimpleObject_Should_Be_Cloned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class SpecificScenariosTest
public class SpecialCaseTests
{
[OneTimeSetUp]
public void Setup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace FastCloner.Tests;

[TestFixture]
public class SystemTypesSpec
public class TypeTests
{
[Test]
public void StandardTypes_Should_Be_Cloned()
Expand Down Expand Up @@ -66,10 +66,14 @@ public void Funcs_Should_Be_Cloned()
Func<int, string> df = f.DeepClone();
Func<int, string> cf = f.ShallowClone();
closure[0] = "xxx";
Assert.That(f(3), Is.EqualTo("xxx3"));
// we clone delegate together with a closure
Assert.That(df(3), Is.EqualTo("1233"));
Assert.That(cf(3), Is.EqualTo("xxx3"));

Assert.Multiple(() =>
{
Assert.That(f(3), Is.EqualTo("xxx3"));
// we clone delegate together with a closure
Assert.That(df(3), Is.EqualTo("1233"));
Assert.That(cf(3), Is.EqualTo("xxx3"));
});
}

public class EventHandlerTest1
Expand Down Expand Up @@ -105,9 +109,13 @@ public void Events_Should_Be_Cloned()
Assert.That(summ[0], Is.EqualTo(2));
eht.Event -= a1;
eht.Event -= a2;
Assert.That(eht.Call(1), Is.EqualTo(0)); // 0
Assert.That(summ[0], Is.EqualTo(2)); // nothing to increment
Assert.That(clone.Call(1), Is.EqualTo(2));

Assert.Multiple(() =>
{
Assert.That(eht.Call(1), Is.EqualTo(0)); // 0
Assert.That(summ[0], Is.EqualTo(2)); // nothing to increment
Assert.That(clone.Call(1), Is.EqualTo(2));
});
}

private const string CertData =
Expand Down

0 comments on commit 64de6a6

Please sign in to comment.