Esempio n. 1
0
        public void TaskSuccessTest()
        {
            var seedPros = new SeedPerformingRightsOrganizations(DbContext, new SeedCountries(DbContext));

            seedPros.DoTask(null);

            var task   = new ListPerformingRightsOrganizations(DbContext);
            var result = task.DoTask(null);

            Assert.IsTrue(result.Success);
            Assert.IsNull(result.Exception);
            Assert.IsNotNull(result.Data);
            Assert.IsTrue(result.Data.Any());

            foreach (var performingRightsOrganization in result.Data)
            {
                Assert.IsTrue(performingRightsOrganization.Name.Length > 0);
                Assert.IsNotNull(performingRightsOrganization.Country);
                Assert.IsTrue(performingRightsOrganization.Country.Name.Length > 0);
                Assert.IsTrue(performingRightsOrganization.Country.IsoCode.Length > 0);
            }
        }
Esempio n. 2
0
        public TestsModel(ApplicationDbContext dbContext)
        {
            _dbContext = dbContext;

            var seedInstallation = new SeedInstallation(_dbContext);

            seedInstallation.DoTask(null);

            var seedCountries = new SeedCountries(_dbContext);

            seedCountries.DoTask(null);

            var seedPros = new SeedPerformingRightsOrganizations(_dbContext, new SeedCountries(_dbContext));

            seedPros.DoTask(null);

            var seedServices = new SeedServices(_dbContext);

            seedServices.DoTask(null);

            var seedPlatforms = new SeedPlatforms(_dbContext, new ListServices(_dbContext), new AddPlatform(_dbContext));

            seedPlatforms.DoTask(null);
        }