示例#1
0
        public void OriginalStringHasDefault()
        {
            // arrange
            string actual;
            var    test = new ScrawlText();

            // act
            actual = test.OriginalString;
            var expected = "";

            // assert
            Assert.Equal(expected, actual);
        }
示例#2
0
        public void RebuiltStringHandlesCommaDigits()
        {
            // arrange
            string actual;
            var    test = new ScrawlText();

            // act
            test.OriginalString = "3,123,000";
            actual = test.RebuiltString;
            var expected = "three million one hundred twenty three thousand";

            // assert
            Assert.Equal(expected, actual);
        }
示例#3
0
        public void RebuiltStringHandlesWordsDigits()
        {
            // arrange
            string actual;
            var    test = new ScrawlText();

            // act
            test.OriginalString = "3 strikes and you out";
            actual = test.RebuiltString;
            var expected = "three strikes and you out";

            // assert
            Assert.Equal(expected, actual);
        }
示例#4
0
        public void RebuiltStringHandlesDigits()
        {
            // arrange
            string actual;
            var    test = new ScrawlText();

            // act
            test.OriginalString = "13";
            actual = test.RebuiltString;
            var expected = "thirteen";

            // assert
            Assert.Equal(expected, actual);
        }
示例#5
0
        public void PostReturnsUpdatedST()
        {
            // Arrange
            var test      = new NumToTextServiceController();
            var forminput = new ScrawlText();

            forminput.OriginalString = "2";

            // Act
            var actual    = test.Post(forminput);
            var expected1 = "2";
            var expected2 = "two";

            // Assert
            Assert.IsType <ScrawlText>(actual);
            Assert.Equal(expected1, actual.OriginalString);
            Assert.Equal(expected2, actual.RebuiltString);
        }
 public ScrawlText Post(ScrawlText formInput)
 {
     st.OriginalString = formInput.OriginalString;
     st.RebuiltString  = st.RebuiltString;
     return(st);
 }