Пример #1
0
 public void TryParseValue_WhenValidValue_HasExpectedEnumeration(int value, FakeEnumeration expected)
 {
     // Act
     Enumeration.TryParseValue <FakeEnumeration>(value, out var result);
     // Assert
     result.Should().BeSameAs(expected);
 }
Пример #2
0
        public void FromValue_WhenValidValue_ReturnsExpectedEnumeration(int value, FakeEnumeration expected)
        {
            // Act
            var result = Enumeration.FromValue <FakeEnumeration>(value);

            // Assert
            result.Should().BeSameAs(expected);
        }
Пример #3
0
        public void FromName_WhenValidName_ReturnsExpectedEnumeration(string name, bool ignoreCase, FakeEnumeration expected)
        {
            // Act
            var result = Enumeration.FromName <FakeEnumeration>(name, ignoreCase);

            // Assert
            result.Should().BeSameAs(expected);
        }
Пример #4
0
 public void TryParseName_WhenValidName_HasExpectedEnumeration(string name, bool ignoreCase, FakeEnumeration expected)
 {
     // Act
     Enumeration.TryParseName <FakeEnumeration>(name, ignoreCase, out var result);
     // Assert
     result.Should().BeSameAs(expected);
 }
Пример #5
0
 public void TryParseCode_WhenValidCode_HasExpectedResult(string code, bool ignoreCase, FakeEnumeration expected)
 {
     // Act
     Enumeration.TryParseCode <FakeEnumeration>(code, ignoreCase, out var result);
     // Assert
     result.Should().BeSameAs(expected);
 }
Пример #6
0
        public void ParseCode_WhenValidCode_ReturnsExpectedEnumeration(string code, bool ignoreCase, FakeEnumeration expected)
        {
            // Act
            var result = Enumeration.ParseCode <FakeEnumeration>(code, ignoreCase);

            // Assert
            result.Should().BeSameAs(expected);
        }