예제 #1
0
        public async Task OwnerService_RetrieveMaleList_True()
        {
            // Arrange
            // See Constructor/Setup above

            IOwnerService ownerService = new OwnerService(_loggerMock.Object,
                                                          _urlHelper.Object,
                                                          _httpClientMock,
                                                          _deserializer.Object,
                                                          _repositoryOwner,
                                                          _sortOwner);

            // Act
            IList <Owner> list = await ownerService.GetByGender("Male", true);

            // Assert
            Assert.NotNull(list);
            Assert.True(list.Count > 0);
            Assert.NotNull(list[0]);

            Assert.Equal("Male", list[0].Gender);
            Assert.Equal("Male", list[1].Gender);

            Assert.Equal("Bob", list[0].Name);
        }
예제 #2
0
        public async Task OwnerService_RetrieveUknownGenderIsNull_True()
        {
            // Arrange
            // See Constructor/Setup above

            IOwnerService ownerService = new OwnerService(_loggerMock.Object,
                                                          _urlHelper.Object,
                                                          _httpClientMock,
                                                          _deserializer.Object,
                                                          _repositoryOwner,
                                                          _sortOwner);

            // Act
            IList <Owner> list = await ownerService.GetByGender("Unknown", true);

            // Assert
            Assert.NotNull(list);
            Assert.True(list.Count == 0);
        }