Ejemplo n.º 1
0
        public void Execute_PassMeansAndVocabularyReturnsEmptyResults_ReturnsMeansAreAlreadyAdded()
        {
            // Arrange
            var word    = "aaa";
            var means   = new [] { "bbb", "ccc" };
            var command = new AddCommand(VocabularyStubFactory.Add(word, means, new string[0]));

            // Act
            var result = command.Execute(new [] { word }.Concat(means));

            // Assert
            Assert.AreEqual(result, Default.MeansAreAlreadyAdded);
        }
Ejemplo n.º 2
0
        public void Execute_PassMeansAndVocabularyReturnAddedMeans_ReturnMeansAddedFormattedMessage()
        {
            // Arrange
            var word       = "aaa";
            var means      = new[] { "bbb", "ccc" };
            var addedMeans = new[] { "ddd", "eee" };
            var command    = new AddCommand(VocabularyStubFactory.Add(word, means, addedMeans));

            // Act
            var result = command.Execute(new[] { word }.Concat(means));

            // Assert
            Assert.AreEqual(result, string.Format(Default.MeansAdded, $"{addedMeans[0]}, {addedMeans[1]}"));
        }