Пример #1
0
        public void WhenValidProjectThenScenarioCountShouldBeGreaterThanZero()
        {
            // Arrange
            int scenarioCount;

            var userId        = TestInitializeUtils.CreateTestUser();
            var applicationId = TestInitializeUtils.CreateTestApplication();
            var projectId     = TestInitializeUtils.CreateTestProject(applicationId, userId);

            TestInitializeUtils.CreateTestScenario(projectId);
            TestInitializeUtils.CreateTestScenario(projectId);

            // Act
            using (var unitOfWork = new UnitOfWork(_context))
            {
                var scenarios = unitOfWork.Scenarios.GetScenariosForProject(projectId);
                scenarioCount = scenarios.ToList().Count;
            }

            // Assert
            Assert.AreEqual(2, scenarioCount);
        }
Пример #2
0
        public void WhenValidUserThenProjectsAndRelatedScenariosShouldBeGreaterThanZero()
        {
            // Arrange
            int scenarioCount;

            var userId        = TestInitializeUtils.CreateTestUser();
            var applicationId = TestInitializeUtils.CreateTestApplication();
            var projectId     = TestInitializeUtils.CreateTestProject(applicationId, userId);

            TestInitializeUtils.CreateTestScenario(projectId);
            TestInitializeUtils.CreateTestScenario(projectId);

            // Act
            using (var unitOfWork = new UnitOfWork(_context))
            {
                var projects = unitOfWork.Projects.GetProjectsAndReleatedScenariosForUser(userId);
                var project  = projects.First();

                scenarioCount = project.Scenarios.Count;
            }

            // Assert
            Assert.AreEqual(2, scenarioCount);
        }