-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from benpollarduk/minor-issues
Minor issues
- Loading branch information
Showing
24 changed files
with
378 additions
and
272 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
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 was deleted.
Oops, something went wrong.
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
70 changes: 70 additions & 0 deletions
70
NetAF.Tests/Serialization/Assets/AttributeAndValueSerialization_Tests.cs
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NetAF.Assets.Attributes; | ||
using NetAF.Serialization.Assets; | ||
|
||
namespace NetAF.Tests.Serialization.Assets | ||
{ | ||
[TestClass] | ||
public class AttributeAndValueSerialization_Tests | ||
{ | ||
[TestMethod] | ||
public void GivenAttributeWhenNameIsA_WhenFromAttribute_ThenNameIsA() | ||
{ | ||
Attribute attribute = new("A", "B", 5, 10); | ||
|
||
AttributeAndValueSerialization result = AttributeAndValueSerialization.FromAttributeAndValue(new(attribute, 0)); | ||
|
||
Assert.AreEqual("A", result.Name); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenAttributeWhenDescriptionIsB_WhenFromAttribute_ThenDescriptionIsB() | ||
{ | ||
Attribute attribute = new("A", "B", 5, 10); | ||
|
||
AttributeAndValueSerialization result = AttributeAndValueSerialization.FromAttributeAndValue(new(attribute, 0)); | ||
|
||
Assert.AreEqual("B", result.Description); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenAttributeWhenMinimumIs5_WhenFromAttribute_ThenMinimumIs5() | ||
{ | ||
Attribute attribute = new("A", "B", 5, 10); | ||
|
||
AttributeAndValueSerialization result = AttributeAndValueSerialization.FromAttributeAndValue(new(attribute, 0)); | ||
|
||
Assert.AreEqual(5, result.Minimum); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenAttributeWhenMaximumIs10_WhenFromAttribute_ThenMaximumIs10() | ||
{ | ||
Attribute attribute = new("A", "B", 5, 10); | ||
|
||
AttributeAndValueSerialization result = AttributeAndValueSerialization.FromAttributeAndValue(new(attribute, 0)); | ||
|
||
Assert.AreEqual(10, result.Maximum); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenAttributeWhenValueIs3_WhenFromAttribute_ThenValueIs3() | ||
{ | ||
Attribute attribute = new("A", "B", 5, 10); | ||
|
||
AttributeAndValueSerialization result = AttributeAndValueSerialization.FromAttributeAndValue(new(attribute, 3)); | ||
|
||
Assert.AreEqual(3, result.Value); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenRestore_ThenNoExceptionThrown() | ||
{ | ||
Assertions.NoExceptionThrown(() => | ||
{ | ||
AttributeAndValueSerialization value = new(); | ||
value.Restore(new System.Collections.Generic.KeyValuePair<Attribute, int>()); | ||
}); | ||
} | ||
} | ||
} |
65 changes: 0 additions & 65 deletions
65
NetAF.Tests/Serialization/Assets/AttributeSerialization_Tests.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.