public async void GivenNewScreeningWithTwoScreeningsInDatabase_WhenAddingAThirdScreening_ThenThirdScreeningIsAdded()
        {
            var       testGuid      = Guid.NewGuid();
            Screening testScreening = new CV_Screening("testtess", testGuid);

            testScreening.UpdateStatusToFalse();
            Screening        testScreening2 = new Phone_Screening("ezqdsrezrez", testGuid);
            Screening        testScreening3 = new TestResults_Screening("ezqdsrezrazezaeez", testGuid);
            List <Screening> testList       = new List <Screening>()
            {
                testScreening, testScreening2
            };

            var mockRepo = Substitute.For <ScreeningRepository>();

            mockRepo.AddNewScreeningToDatabase(testScreening3)
            .Returns(Task.FromResult(testScreening3));
            mockRepo.GetAllById(testGuid)
            .Returns(Task.FromResult(testList));
            var mockLogger = Substitute.For <ILoggerManager>();
            var mockJopApp = Substitute.For <IJobApplicationService>();
            var service    = new ScreeningService(mockRepo, mockLogger, mockJopApp);

            var actualScreenings = await service.NewScreening(testGuid.ToString(), testScreening3.Comment);

            Assert.True(actualScreenings.Count == 3);
            Assert.Equal(testScreening3.Comment, actualScreenings[2].Comment);
            Assert.IsType <TestResults_Screening>(actualScreenings[2]);
            Assert.False(actualScreenings[1].Status);
        }
        public async void GivenNewScreeningWithFiveScreeningsInDatabase_WhenAddingSixthScreening_ThenSixthScreeningIsAdded()
        {
            var testGuid   = Guid.NewGuid();
            var testJobApp = new JobApplication(testGuid, Guid.NewGuid(), Guid.NewGuid(), 4);

            Screening testScreening = new CV_Screening("testtess", testGuid);

            testScreening.UpdateStatusToFalse();
            Screening testScreening2 = new Phone_Screening("ezqdsrezrez", testGuid);

            testScreening2.UpdateStatusToFalse();
            Screening testScreening3 = new TestResults_Screening("ezqdsrezrazezaeez", testGuid);

            testScreening3.UpdateStatusToFalse();
            Screening testScreening4 = new FirstInterview_Screening("eblabla", testGuid);

            testScreening4.UpdateStatusToFalse();
            Screening        testScreening5 = new GroupInterview_Screening("eblabdsdsfdsfla", testGuid);
            Screening        testScreening6 = new FinalDecision_Screening("aangenome", testGuid);
            List <Screening> testList       = new List <Screening>()
            {
                testScreening, testScreening2, testScreening3, testScreening4, testScreening5
            };

            var mockRepo = Substitute.For <ScreeningRepository>();

            mockRepo.AddNewScreeningToDatabase(testScreening6)
            .Returns(Task.FromResult(testScreening6));
            mockRepo.GetAllById(testGuid)
            .Returns(Task.FromResult(testList));
            var mockLogger = Substitute.For <ILoggerManager>();
            var mockJopApp = Substitute.For <IJobApplicationService>();

            mockJopApp.UpdateStatusOfJobApplication(testGuid.ToString(), 4)
            .Returns(Task.FromResult(testJobApp));
            var service = new ScreeningService(mockRepo, mockLogger, mockJopApp);

            var actualScreenings = await service.NewScreening(testGuid.ToString(), testScreening6.Comment);

            Assert.Equal(testJobApp.StatusId, 4);
            Assert.True(actualScreenings.Count == 6);
            Assert.Equal(testScreening6.Comment, actualScreenings[5].Comment);
            Assert.IsType <FinalDecision_Screening>(actualScreenings[5]);
            Assert.False(actualScreenings[4].Status);
            Assert.False(actualScreenings[5].Status);
        }
        public async void GivenNewScreening_WhenAddingANewScreening_ThenNewScreeningIsAdded()
        {
            var              testGuid      = Guid.NewGuid();
            Screening        testScreening = new CV_Screening("testtess", testGuid);
            List <Screening> testList      = new List <Screening>();

            var mockRepo = Substitute.For <ScreeningRepository>();

            mockRepo.AddNewScreeningToDatabase(testScreening)
            .Returns(Task.FromResult(testScreening));
            mockRepo.GetAllById(testGuid)
            .Returns(Task.FromResult(testList));
            var mockLogger = Substitute.For <ILoggerManager>();
            var mockJopApp = Substitute.For <IJobApplicationService>();
            var service    = new ScreeningService(mockRepo, mockLogger, mockJopApp);

            var actualScreenings = await service.NewScreening(testGuid.ToString(), testScreening.Comment);

            Assert.Single <Screening>(actualScreenings);
            Assert.Equal(testScreening.Comment, actualScreenings[0].Comment);
        }