Example #1
0
        public async Task CheckIfExistsAsyncShouldReturnFalse()
        {
            var townRepo                  = new Repository <Town>(db);
            var useFullCategory           = new Repository <UseFullCategory>(db);
            var companyRepo               = new Repository <Company>(db);
            var townUseFullCategoriesRepo = new Repository <TownUseFullCategory>(db);
            var useFullCategoryService    = new UseFullCategoryService(useFullCategory,
                                                                       townRepo,
                                                                       townUseFullCategoriesRepo, companyRepo);
            var townService = new TownService(townRepo, townUseFullCategoriesRepo, useFullCategoryService, companyRepo);

            await townService.CreateTownByNameAsync("Test");

            var ifExists = await townService.CheckIfExistsAsync("Test1");

            Assert.False(ifExists);
        }