示例#1
0
        public void Given_Empty_Value_Should_Return_True_In_IsUnformatted()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.True(formatter.IsUnformatted(""));
        }
示例#2
0
        public void Given_Formatted_Value_Should_Be_True_In_IsFormatted()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.True(formatter.IsFormatted(FormattedValue));
        }
示例#3
0
        public void Given_Valid_Format_Value_Should_Be_True_In_IsFormattable(string value)
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.True(formatter.IsFormattable(value));
        }
示例#4
0
        public void Given_Null_Value_Should_Throw_Exception_In_Unformat()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.Throws <ArgumentNullException>(() => formatter.Unformat(null));
        }
示例#5
0
        public void Given_Invalid_Format_Value_Should_Throw_Exception_In_Unformat()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.Throws <InvalidOperationException>(() => formatter.Unformat(InvalidFormat));
        }
示例#6
0
        public void Given_Valid_Format_Value_Should_Not_Throw_Exception_In_AssertFormattable(string value)
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            formatter.AssertFormattable(value);
        }
示例#7
0
        public void Given_Invalid_Format_Value_Should_False_In_IsUnformatted()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act and Assert
            Assert.False(formatter.IsUnformatted(InvalidFormat));
        }
示例#8
0
        public void Given_Empty_Value_Should_Return_Empty_In_Unformat()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act
            var unformattedTest = formatter.Unformat("");

            // Assert
            Assert.Equal("", unformattedTest);
        }
示例#9
0
        public void Given_Unformatted_Value_Should_Continue_Unformatted_In_Unformat()
        {
            // Arrange
            IFormatter formatter = new TestedFormatter();

            // Act
            var formattedTest = formatter.Unformat(UnformattedValue);

            // Assert
            Assert.Equal(UnformattedValue, formattedTest);
        }