Ejemplo n.º 1
0
        public void Sort_ValidString_ReturnsSortedStringDescending()
        {
            //arrange
            var input = GetValidStringInput();
            //act
            IStringService stringService = new StringService();
            var            result        = stringService.ProcessSort(input);

            //assert
            Assert.AreEqual("11,9,7,5,2", result.InputString);
        }
Ejemplo n.º 2
0
        public void Sort_EmptyString_ReturnsInputStringRequired()
        {
            //arrange
            var input = GetValidStringInput();

            input.InputString = "";

            //act
            IStringService stringService = new StringService();
            var            result        = stringService.ProcessSort(input);

            //assert
            Assert.AreEqual(StringError.InputStringRequired, result.Error);
        }
Ejemplo n.º 3
0
        public void Sort_StringWithNonNumbers_ReturnsInputStringNotInteger()
        {
            //arrange
            var input = GetValidStringInput();

            input.InputString = input.InputString + "sometext";

            //act
            IStringService stringService = new StringService();
            var            result        = stringService.ProcessSort(input);

            //assert
            Assert.AreEqual(StringError.InputStringNotInteger, result.Error);
        }