Пример #1
0
        public async void Update_Entity_Is_Tracked()
        {
            Mock <ILogger <AdminRepository> > loggerMoc = AdminRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = AdminRepositoryMoc.GetContext();
            var   repository             = new AdminRepository(loggerMoc.Object, context);
            Admin entity = new Admin();

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

            var record = await repository.Get(entity.Id);

            await repository.Update(record);

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

            modifiedRecord.Should().NotBeNull();
        }