Esempio n. 1
0
        private async Task <TDomain> AssertFindDomainByIdAsync(TDomain domainToFind)
        {
            var foundDomain = await FindDomainByIdAsync(domainToFind).ConfigureAwait(false);

            RepositoryTestCase.AssertPositiveCaseAndExpectedVsActualValues(foundDomain, domainToFind);
            return(foundDomain);
        }
Esempio n. 2
0
 private List <TDomain> GenerateListOfDomains()
 {
     return(new List <TDomain>
     {
         RepositoryTestCase.GenerateTestCaseMember(),
         RepositoryTestCase.GenerateTestCaseMember(),
         RepositoryTestCase.GenerateTestCaseMember()
     });
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        /// <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());
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 private void CheckFile(FilePath f, string text)
 {
     RepositoryTestCase.CheckFile(f, text);
 }
Esempio n. 10
0
 /// <exception cref="System.Exception"></exception>
 /// <exception cref="System.IO.IOException"></exception>
 private static void FsTick()
 {
     RepositoryTestCase.FsTick(null);
 }