示例#1
0
        public async Task UpdatedTemporalEntity_IsUpdated_OnSaveChangesAsync()
        {
            using (var context = new TestHedwigContextProvider().Context)
            {
                var family    = FamilyHelper.CreateFamily(context);
                var updatedAt = family.UpdatedAt;
                context.Update(family);
                await context.SaveChangesAsync();

                Assert.NotNull(family.AuthorId);
                Assert.NotNull(family.UpdatedAt);
                Assert.NotEqual(updatedAt, family.UpdatedAt);
            }
        }
示例#2
0
        public async Task AddedTemporalEntity_IsUpdated_OnSaveChangesAsync()
        {
            using (var context = new TestHedwigContextProvider().Context)
            {
                var family = new Family
                {
                    OrganizationId = context.Organizations.First().Id
                };
                context.Add(family);
                await context.SaveChangesAsync();

                Assert.NotNull(family.AuthorId);
                Assert.NotNull(family.UpdatedAt);
            }
        }