Index: Core/Common/test/Core.Common.Gui.Test/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttributeTest.cs =================================================================== diff -u -r7ce1153d6af94b372e527cfb2c9128924e340a4f -r8bf7f7da2ce10b6eff2263b4c0c348ba06a9e6f1 --- Core/Common/test/Core.Common.Gui.Test/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttributeTest.cs (.../KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttributeTest.cs) (revision 7ce1153d6af94b372e527cfb2c9128924e340a4f) +++ Core/Common/test/Core.Common.Gui.Test/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttributeTest.cs (.../KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttributeTest.cs) (revision 8bf7f7da2ce10b6eff2263b4c0c348ba06a9e6f1) @@ -36,7 +36,7 @@ // Call void Call() => new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(null, nameof(TestObject.Unit), - "value"); + nameof(TestObject.Value)); // Assert var exception = Assert.Throws(Call); @@ -47,9 +47,9 @@ public void Constructor_WithoutUnitPropertyName_ThrowsArgumentNullException() { // Call - void Call() => new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute("name", + void Call() => new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), null, - "value"); + nameof(TestObject.Value)); // Assert var exception = Assert.Throws(Call); @@ -60,7 +60,7 @@ public void Constructor_WithoutValuePropertyName_ThrowsArgumentNullException() { // Call - void Call() => new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute("name", + void Call() => new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), nameof(TestObject.Unit), null); @@ -73,36 +73,16 @@ public void Constructor_WithParameters_CreatesNewInstance() { // Call - var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute("name", - nameof(TestObject.Unit), - "value"); - - // Assert - Assert.IsInstanceOf(attribute); - } - - [Test] - public void GetName_WithObjectWithProperty_ReturnsValueOfProperty() - { - // Setup - const string expectedName = "expectedName"; - var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), nameof(TestObject.Unit), nameof(TestObject.Value)); - // Call - string name = attribute.GetName(new TestObject - { - Name = expectedName - }); - // Assert - Assert.AreEqual(expectedName, name); + Assert.IsInstanceOf(attribute); } [Test] - public void GetName_WithObjectWithProperties_ReturnsValueOfProperties() + public void GetName_ValidProperties_ReturnsExpectedValu() { // Setup const string expectedName = "expectedName"; @@ -124,7 +104,7 @@ } [Test] - public void GetName_WithObjectWithoutPropertyWithName_ThrowsArgumentException() + public void GetName_InvalidNameProperty_ThrowsArgumentException() { // Setup var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute("IDoNotExist", @@ -140,7 +120,7 @@ } [Test] - public void GetName_WithObjectWithoutPropertyWithUnit_ThrowsArgumentException() + public void GetName_InvalidUnitProperty_ThrowsArgumentException() { // Setup var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), @@ -206,7 +186,7 @@ // Setup int expectedValue = new Random(21).Next(3, 50); - var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.NonStringName), + var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), nameof(TestObject.Unit), nameof(TestObject.NonRoundedDoubleValue)); @@ -223,7 +203,7 @@ } [Test] - public void GetValue_WithObjectWithoutPropertyWithName_ThrowsArgumentException() + public void GetValue_InvalidValueProperty_ThrowsArgumentException() { // Setup var attribute = new KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute(nameof(TestObject.Name), @@ -243,10 +223,6 @@ public string Name { get; set; } public string Unit { get; set; } public RoundedDouble Value { get; set; } - - public int NonStringName { get; set; } - - public int NonStringUnit { get; set; } public int NonRoundedDoubleValue { get; set; } } }