Exemple #1
0
        public void Search(string title, int? page)
        {
            // Arrange
            var api = new OMDbApiMock();
            var itemList = new List<ApiSearchDto>
            {
                TestHelper.GetSearchDto("1"),
                TestHelper.GetSearchDto("2"),
                TestHelper.GetSearchDto("3")
            };
            api.InitSearchMock(itemList);

            // Act
            var result = api.Search(title, page);

            // Assert
            var expected = new ApiSearchRootDto()
            {
                Search = new List<ApiSearchDto>()
                {
                    TestHelper.GetSearchDto(title)
                },
                Response = true,
                TotalResults = 1
            };
            AssertHelper.AreEqual(expected, result);
        }
Exemple #2
0
        public void Details(string id)
        {
            // Arrange
            var api = new OMDbApiMock();
            var detailsList = new List<ApiDetailsDto>()
            {
                TestHelper.GetDetailsDto("1"),
                TestHelper.GetDetailsDto("2"),
                TestHelper.GetDetailsDto("3"),
            };
            api.InitDetailsMock(detailsList);

            // Act
            var result = api.GetDetails(id);

            // Assert
            var expected = TestHelper.GetDetailsDto(id);
            AssertHelper.AreEqual(expected, result);
        }