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); }
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); }