private async Task <TDomain> AssertFindDomainByIdAsync(TDomain domainToFind) { var foundDomain = await FindDomainByIdAsync(domainToFind).ConfigureAwait(false); RepositoryTestCase.AssertPositiveCaseAndExpectedVsActualValues(foundDomain, domainToFind); return(foundDomain); }
private List <TDomain> GenerateListOfDomains() { return(new List <TDomain> { RepositoryTestCase.GenerateTestCaseMember(), RepositoryTestCase.GenerateTestCaseMember(), RepositoryTestCase.GenerateTestCaseMember() }); }
protected async Task CrudAsyncTestCase() { var expectedDomain = RepositoryTestCase.GenerateTestCaseMember(); var insertedDomain = await AssertInsertedDomainAsync(expectedDomain).ConfigureAwait(false); var updatedDomain = await AssertUpdatedDomainAsync(insertedDomain).ConfigureAwait(false); await AssertRemoveDomainAsync(updatedDomain).ConfigureAwait(false); }
private async Task AssertRemoveDomainAsync(TDomain domainToRemove) { var removedDomain = await Repository.RemoveAsync(domainToRemove).ConfigureAwait(false); RepositoryTestCase.AssertExpectedVsActualValues(domainToRemove, removedDomain); var foundCategory = await FindDomainByIdAsync(domainToRemove).ConfigureAwait(false); RepositoryTestCase.AssertNegativeCaseOnResult(foundCategory); }
private async Task <TDomain> AssertInsertedDomainAsync(TDomain expectedDomain) { var insertedDomain = await Repository.AddAsync(expectedDomain).ConfigureAwait(false); RepositoryTestCase.AssertExpectedVsActualValues(expectedDomain, insertedDomain); var foundDomain = await AssertFindDomainByIdAsync(insertedDomain); return(foundDomain); }
protected async Task GetAllAsyncTestCase() { var domainsToInsert = GenerateListOfDomains(); var expectedResults = AssertInsertMultipleDomains(domainsToInsert); var actualResults = await Repository.GetAllAsync().ConfigureAwait(false); RepositoryTestCase.AssertPositiveCaseOnListOfResults(expectedResults, actualResults); await AssertAllDomainsAreRemoved(expectedResults); }
/// <exception cref="System.Exception"></exception> private void CheckFile(string fileName, params string[] lines) { FilePath file = new FilePath(db.WorkTree, fileName); StringBuilder sb = new StringBuilder(); foreach (string line in lines) { sb.Append(line); sb.Append('\n'); } RepositoryTestCase.CheckFile(file, sb.ToString()); }
private async Task <TDomain> AssertUpdatedDomainAsync(TDomain insertedDomain) { var foundDomain = await FindDomainByIdAsync(insertedDomain).ConfigureAwait(false); RepositoryTestCase.AssertPositiveCaseOnResult(foundDomain); var expectedDomain = Clone(foundDomain); var updatePropertyOnDomain = UpdatePropertyOnDomain(foundDomain); var updatedDomain = await Repository.UpdateAsync(updatePropertyOnDomain).ConfigureAwait(false); RepositoryTestCase.AssertUpdatedExpectedVsActualValues(expectedDomain, updatedDomain); return(updatedDomain); }
private void CheckFile(FilePath f, string text) { RepositoryTestCase.CheckFile(f, text); }
/// <exception cref="System.Exception"></exception> /// <exception cref="System.IO.IOException"></exception> private static void FsTick() { RepositoryTestCase.FsTick(null); }