Пример #1
0
        public void FilterShows_ReturnsNull_WhenRequestIsNull()
        {
            //Arrange
            var target = new FilterService();

            //Action

            var actual = target.FilterShows(null);

            //Assert

            Assert.IsNull(actual);
        }
Пример #2
0
        public void FilterShows_Returns_CorrectNumberOfShows()
        {
            //Arrange
            var target = new FilterService();
            var expected = ShowsMockHelper.GetMockedShows().Length;
            //Action

            var actual = target.FilterShows(ShowsMockHelper.GetMockedRequest());

            //Assert

            Assert.IsNotNull(actual);
            Assert.AreEqual(actual.Length, expected);
        }
Пример #3
0
        public void FilterShows_ReturnsCorrectShows_ForAValidRequest()
        {
            //Arrange
            var target = new FilterService();
            var expected = ShowsMockHelper.GetMockedShows();
            //Action

            var actual = target.FilterShows(ShowsMockHelper.GetMockedRequest());

            //Assert

            Assert.IsNotNull(actual);
            CollectionAssert.AreEqual(actual, expected);
        }
Пример #4
0
        public void FilterShows_ReturnsNull_WhenPayloadIsNull()
        {
            //Arrange
            var target = new FilterService();
            var request = new Request();

            //Action

            var actual = target.FilterShows(request);

            //Assert

            Assert.IsNull(actual);
        }
Пример #5
0
        public void FilterShows_Always_ReturnAnArrayOfShows()
        {
            //Arrange
            var target = new FilterService();

            //Action

            var actual = target.FilterShows(ShowsMockHelper.GetMockedRequest());

            //Assert

            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual,typeof(Show[]));
        }