public void GetCurrencyById_returnNull_forNonExistingItem() { //Arrange EFCurrencyRepository repository = new EFCurrencyRepository(); CurrencyDto baseDto = getDefaultCurrencyDto(); insertCurrencyToTestDb(baseDto); //Act CurrencyDto dto = repository.GetCurrencyById(baseDto.Id + 1); //Assert Assert.IsNull(dto); }
public void GetCurrencyById_returnProperDto_forExistingItem() { //Arrange EFCurrencyRepository repository = new EFCurrencyRepository(); CurrencyDto baseDto = getDefaultCurrencyDto(); insertCurrencyToTestDb(baseDto); //Act CurrencyDto dto = repository.GetCurrencyById(baseDto.Id); //Assert var areEqual = baseDto.Equals(dto); Assert.IsTrue(areEqual); }