예제 #1
0
        public void ThrowWhen_NoItemsInBoard()
        {
            //Arrange
            var fakeProvider = new FakeWorkItemProvider();
            var list         = new List <string>();
            var sut          = new SortAllItemsByRatingCommand(list, fakeProvider);

            //Act & Assert
            Assert.ThrowsException <ArgumentException>(() => sut.Execute());
        }
예제 #2
0
        public void ReturnCorrectString()
        {
            //Arrange
            var fakeProvider = new FakeWorkItemProvider();
            var listParams   = new List <string>();

            var feedback1 = new Feedback("NewFeedback1", "Feed1Description", 5);
            var feedback2 = new Feedback("NewFeedback2", "Feed2Descriptin", 9);

            fakeProvider.Add(feedback1);
            fakeProvider.Add(feedback2);

            var sut = new SortAllItemsByRatingCommand(listParams, fakeProvider);

            //Act
            var result = sut.Execute();

            //Assert
            Assert.IsTrue(result.StartsWith($"Feedback:{Environment.NewLine}  Title: NewFeedback1"));
        }