public void async_crud_process_succeeds() { var entityId = 707; var userStatus = _fixture.PubsDbContext.ApplicationUserStatuses.FirstOrDefault(x => x.Id == 1001); var entity = new ApplicationUser(new DateTime(2021, 08, 15)) { Id = entityId, UserName = "******", UserPrincipalName = "*****@*****.**", FirstName = "User", MiddleName = "J.", LastName = "Test", EmailAddress = "*****@*****.**", PhoneNumber = "3039876543" }; entity.UpdateApplicationUserStatus(userStatus); var savedEntity = _repository.AddAsync(entity).Result; var updatedEntity = _repository.GetByIdAsync(entity.Id).Result; using (new AssertionScope()) { savedEntity.Should().NotBeNull(); savedEntity.Id.Should().Be(entityId); savedEntity.FirstName.Should().Be("User"); savedEntity.PhoneNumber.Should().Be("3039876543"); savedEntity.IsActive.Should().BeTrue(); updatedEntity.Should().NotBeNull(); updatedEntity.Id.Should().Be(entityId); updatedEntity.FirstName.Should().Be("User"); updatedEntity.PhoneNumber.Should().Be("3039876543"); updatedEntity.FirstName = "UnitUnit"; updatedEntity.LastName = "LastName"; _ = _repository.UpdateAsync(updatedEntity); updatedEntity = _repository.GetByIdAsync(updatedEntity.Id).Result; updatedEntity.FirstName.Should().Be("UnitUnit"); updatedEntity.LastName.Should().Be("LastName"); _ = _repository.DeleteAsync(updatedEntity); _repository.GetByIdAsync(entityId).Result.Should().BeNull(); } }