示例#1
0
        public void GetEnumDescription()
        {
            TestEnum opt   = TestEnum.Option1;
            string   check = opt.GetDescription();

            Assert.Equal("Option One", check);
        }
示例#2
0
        public void GetDescription_WithoutDescription()
        {
            // Arrange
            TestEnum item = TestEnum.Two;
            // Act
            string description = item.GetDescription();

            // Assert
            Assert.AreEqual("Two", description);
        }
示例#3
0
        public void GetDescription_WithDescription()
        {
            // Arrange
            TestEnum item = TestEnum.One;
            // Act
            string description = item.GetDescription();

            // Assert
            Assert.AreEqual(TestEnumOneDescription, description);
        }
        public void GetDescription_DefinedValue_ReturnsDescription(TestEnum value, string expectedResult)
        {
            // Act

            var result = value.GetDescription();

            // Assert

            Assert.Equal(expectedResult, result);
        }
示例#5
0
        public void GetDescription_GivenEnumValue_ReturnsDescription(TestEnum testEnum, string expectedDescription)
        {
            //Act
            string description = testEnum.GetDescription();

            //Assert
            description
            .Should()
            .Be(expectedDescription);
        }
示例#6
0
        public void GetDescription_TestEnum_SecondElement_NET452()
        {
            // Arrange
            TestEnum enumToTest = TestEnum.SecondElement;

            // Act
            string actualResults = enumToTest.GetDescription();

            // Assert
            Assert.AreEqual("SecondElementDescription", actualResults);
        }
示例#7
0
        public void GetDescription_TestEnum_ThirdElement_NETCOREAPP1_1()
        {
            // Arrange
            TestEnum enumToTest = TestEnum.ThirdElement;

            // Act
            string actualResults = enumToTest.GetDescription();

            // Assert
            Assert.AreEqual("ThirdElement", actualResults);
        }
示例#8
0
        public void GetDescription_ReturnsCorrectDescriptionCase2()
        {
            // Arrange
            TestEnum enumValue           = TestEnum.First;
            string   expectedDescription = "Something";

            // Act
            string actualDescription = enumValue.GetDescription();

            // Assert
            Assert.AreEqual(expectedDescription, actualDescription);
        }
        public void GetDescription_GivenEnumValueThatHasNoAttribute_ReturnsEnumName()
        {
            //Arrange
            TestEnum testEnum = TestEnum.Red;

            //Act
            string description = testEnum.GetDescription();

            //Assert
            description
            .Should()
            .Be("Red");
        }
示例#10
0
        public void GetDescription_GivenEnumValue_ReturnsDescription()
        {
            //Arrange
            TestEnum testEnum = TestEnum.Green;

            //Act
            string description = testEnum.GetDescription();

            //Assert
            description
            .Should()
            .Be("green");
        }
示例#11
0
        public void GetDescription_GivenEnumValueThatHasNoAttributeAndNameIfNullIsFalse_ReturnsEmptyString()
        {
            //Arrange
            TestEnum testEnum = TestEnum.Red;

            //Act
            string description = testEnum.GetDescription(false);

            //Assert
            description
            .Should()
            .BeEmpty();
        }
 public void GetDescription(TestEnum testEnum, string descriptionExpected)
 {
     Assert.Equal(descriptionExpected, testEnum.GetDescription());
 }
 public void GetDescriptionGetsValueOfDescriptionAttributeOrValueNameIfNoDescriptionAttributeExists(TestEnum enumValue, string expectedDescription)
 {
     var actualDescription = enumValue.GetDescription();
     Assert.AreEqual(expectedDescription, actualDescription);
 }
示例#14
0
        public void GetDescriptionExtensionMethod_ShouldReturnExpectedValue_IfInputValueHasDescription(TestEnum input, string expected)
        {
            string result = input.GetDescription();

            Assert.AreEqual(result, expected);
        }
示例#15
0
        public void HLEnumTests_providedEnumDescription_shouldBeValid(TestEnum val, string expectedOutput)
        {
            string actualOutput = val.GetDescription();

            Assert.AreEqual(actualOutput, expectedOutput);
        }
 //TODO Checar o funcionamento do localized description
 //[InlineData("This is a Localized Description", TestEnum.SixthItem)]
 public void MustGetDescription(string expected, TestEnum value)
 {
     value.GetDescription().ShouldBe(expected);
 }
示例#17
0
 public void GetDescriptionTest()
 {
     Assert.That(TestEnum.Value1.GetDescription(), Is.EqualTo("My first value."));
     Assert.That(TestEnum.Value2.GetDescription(), Is.EqualTo("Value2"));
     Assert.That(test.GetDescription(), Is.EqualTo("Value1, Value2"));
 }
示例#18
0
 public void TestGetDescription(TestEnum enumValue, string expected)
 {
     Assert.That(enumValue.GetDescription(), Is.EqualTo(expected));
 }