-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[del] redundant checks [add] exceptions messages [r] to NUnit 4 [r] to new C# features [deps] tests deps bump to latest
- Loading branch information
Showing
28 changed files
with
296 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,33 +22,33 @@ public void Initialize() | |
public void Set_NullModel_ReplacesWithNothing() | ||
{ | ||
// Act | ||
_template.Model<TestModel>(null).Set(); | ||
_template.Model<TestModel>(null!).Set(); | ||
|
||
// Assert | ||
Assert.AreEqual(" ", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo(" ")); | ||
} | ||
|
||
[Test] | ||
public void Set_NullModelWithWith_ReplacesWithNothing() | ||
{ | ||
// Act | ||
_template.Model<TestModel>(null).With(x => x.CreationTime, x => x.ToString("dd.MM.yyyy")).Set(); | ||
_template.Model<TestModel>(null!).With(x => x.CreationTime, x => x.ToString("dd.MM.yyyy")).Set(); | ||
|
||
// Assert | ||
Assert.AreEqual(" ", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo(" ")); | ||
} | ||
|
||
[Test] | ||
public void Set_Model_SetCorrectly() | ||
{ | ||
// Arrange | ||
var model = new TestModel { CreationTime = new DateTime(2014, 10, 5), Name = "Foo", EMail = "[email protected]", ID = 5 }; | ||
var model = new TestModel { CreationTime = new DateTime(2014, 10, 5, 0, 0, 0, DateTimeKind.Local), Name = "Foo", EMail = "[email protected]", ID = 5 }; | ||
|
||
// Act | ||
_template.Model(model).With(x => x.CreationTime, x => x.ToString("dd.MM.yyyy")).Set(); | ||
|
||
// Assert | ||
Assert.AreEqual("5 Foo [email protected] 05.10.2014", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo("5 Foo [email protected] 05.10.2014")); | ||
} | ||
|
||
[Test] | ||
|
@@ -66,7 +66,7 @@ public void Set_EverythingIsNull_SetCorrectly() | |
_template.Model(model).Set(); | ||
|
||
// Assert | ||
Assert.AreEqual(" ", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo(" ")); | ||
} | ||
|
||
[Test] | ||
|
@@ -87,7 +87,7 @@ public void Add_TwoModels_DataCombined() | |
_template.Model(model2).Add(); | ||
|
||
// Assert | ||
Assert.AreEqual("TestFoo [email protected]@test.com", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo("TestFoo [email protected]@test.com")); | ||
} | ||
|
||
[Test] | ||
|
@@ -105,7 +105,7 @@ public void Set_ModelWithBaseClass_BaseClassFieldsAlsoSet() | |
_template.Model(model).Set(); | ||
|
||
// Assert | ||
Assert.AreEqual("3 Hello!", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo("3 Hello!")); | ||
} | ||
|
||
[Test] | ||
|
@@ -123,6 +123,6 @@ public void Set_ModelWithPrefix_PrefixAdded() | |
_template.Model(model, "Model").Set(); | ||
|
||
// Assert | ||
Assert.AreEqual("3", _template.Get()); | ||
Assert.That(_template.Get(), Is.EqualTo("3")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.