예제 #1
0
        public async void Update_Entity_Is_Not_Tracked()
        {
            Mock <ILogger <CountryRegionCurrencyRepository> > loggerMoc = CountryRegionCurrencyRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = CountryRegionCurrencyRepositoryMoc.GetContext();
            var repository = new CountryRegionCurrencyRepository(loggerMoc.Object, context);
            CountryRegionCurrency entity = new CountryRegionCurrency();

            context.Set <CountryRegionCurrency>().Add(entity);
            await context.SaveChangesAsync();

            await repository.Update(new CountryRegionCurrency());

            var modifiedRecord = context.Set <CountryRegionCurrency>().FirstOrDefaultAsync();

            modifiedRecord.Should().NotBeNull();
        }