コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }