public async Task CreateIfNotExistTest() { T expected = TestSample.Get <T>(); KAssert.DeepEqual(expected, await _repository.CreateIfNotExists(TestSample.Get <T>())); await _repository.Delete(TestSample.Get <T>()); KAssert.DeepEqual(expected, await _repository.CreateIfNotExists(TestSample.Get <T>())); }
public async Task CreateTest() { await Assert.ThrowsAsync <DuplicatedItemException>(() => _repository.Create(TestSample.Get <T>())); await _repository.Delete(TestSample.Get <T>()); T expected = TestSample.Get <T>(); expected.ID = 0; await _repository.Create(expected); KAssert.DeepEqual(expected, await _repository.Get(expected.Slug)); }
public async Task GetBySlugTest() { T value = await _repository.Get(TestSample.Get <T>().Slug); KAssert.DeepEqual(TestSample.Get <T>(), value); }
public async Task GetExpressionSlugTest() { KAssert.DeepEqual(TestSample.Get <T>(), await _repository.Get(x => x.Slug == TestSample.Get <T>().Slug)); }
public async Task GetExpressionIDTest() { KAssert.DeepEqual(TestSample.Get <T>(), await _repository.Get(x => x.ID == TestSample.Get <T>().ID)); }