private static async Task TestAddWithSeededIdForNoneIdentityAsync(IRepositoryFactory repoFactory) { var repo = repoFactory.Create <CustomerWithNoIdentity>(); const int key = 9; var entity = new CustomerWithNoIdentity { Id = key }; Assert.False(await repo.ExistsAsync(key)); await repo.AddAsync(entity); Assert.Equal(key, entity.Id); Assert.True(await repo.ExistsAsync(key)); }
private static void TestCreateWithSeededIdForNoneIdentity(IUnitOfWorkFactory uowFactory) { var service = new Service <CustomerWithNoIdentity>(uowFactory); const int key = 9; var entity = new CustomerWithNoIdentity { Id = key }; Assert.False(service.GetExists(key)); service.Create(entity); Assert.Equal(key, entity.Id); Assert.True(service.GetExists(key)); }
private static void TestAddWithSeededIdForNoneIdentity(IRepositoryFactory repoFactory) { var repo = repoFactory.Create <CustomerWithNoIdentity>(); const int key = 9; var entity = new CustomerWithNoIdentity { Id = key }; Assert.False(repo.Exists(key)); repo.Add(entity); Assert.Equal(key, entity.Id); Assert.True(repo.Exists(key)); }
private static async Task TestCreateWithSeededIdForNoneIdentityAsync(IUnitOfWorkFactory uowFactory) { var service = new Service <CustomerWithNoIdentity>(uowFactory); const int key = 9; var entity = new CustomerWithNoIdentity { Id = key }; Assert.False(await service.GetExistsAsync(key)); await service.CreateAsync(entity); Assert.Equal(key, entity.Id); Assert.True(await service.GetExistsAsync(key)); }