Пример #1
0
        public void GivenString_GeneratePermutations_ReturnsListOfPermutations()
        {
            //Arrange
            var str = "abc";
            var expectedPermutations = new List <string>
            {
                "abc",
                "acb",
                "bac",
                "bca",
                "cba",
                "cab"
            };
            var stringPermutation = new StringPermutationsV2();

            //Act
            var actualPermutations = stringPermutation.GeneratePermutations(str);

            //Assert
            Assert.AreEqual(expectedPermutations.Count, actualPermutations.Count);
            for (var i = 0; i < expectedPermutations.Count; i++)
            {
                Assert.AreEqual(expectedPermutations[i], actualPermutations[i]);
            }
        }
        public void Given_String_When_GeneratePermutations_Then_ShouldReturnPermutations()
        {
            //Given
            var str = "abc";
            var stringPermutations  = new StringPermutationsV2();
            var expectedPermuations = new HashSet <string>();

            expectedPermuations.Add("abc");
            expectedPermuations.Add("acb");

            //When
            var actualPermuations = stringPermutations.GeneratePermutations(str);

            //Then
            Assert.Inconclusive();
        }