public async Task GET_AMOUNT_OF_MALES_EXPECT_EXCEPTION() { var mockConfig = new Mock <IConfiguration>(); mockConfig.Setup(x => x["BookLocation"]).Returns(projectDirectory + "/Data/NOBOOK"); var addressBook = new AddressBookStore(mockLogger, mockConfig.Object); var processor = new AddressBookProcessor(addressBook); await Assert.ThrowsAsync <AddressBookException>(() => processor.GetAmountOfMales()); }
public async Task GET_AMOUNT_OF_MALES_EXPECT_TWO() { var mockConfig = new Mock <IConfiguration>(); mockConfig.Setup(x => x["BookLocation"]).Returns(projectDirectory + "/Data/InvalidAddressBook"); var addressBook = new AddressBookStore(mockLogger, mockConfig.Object); var processor = new AddressBookProcessor(addressBook); var amountOfMales = await processor.GetAmountOfMales(); Assert.Equal(2, amountOfMales); }