Example #1
0
        public void Given_CandidateRepo_When_GetApprovedCandidatesIsCalled_Then_CountIs1()
        {
            RunOnDatabase(async context =>
            {
                //Arrange
                var candidateRepo = new CandidateRepository(context, _loggerFactory);
                var candidate     = new Candidate
                {
                    Approved  = false,
                    CNP       = "12341423523523",
                    Completed = false,
                    Email     = "*****@*****.**",
                    FirstName = "Candi",
                    LastName  = "date",
                    School    = "yes",
                    Subject   = "matematica"
                };
                var candidate2 = new Candidate
                {
                    Approved  = true,
                    CNP       = "12341423523523",
                    Completed = true,
                    Email     = "*****@*****.**",
                    FirstName = "Candi2",
                    LastName  = "date2",
                    School    = "yes",
                    Subject   = "matematica"
                };

                //Act
                await candidateRepo.AddAsync(candidate);
                await candidateRepo.AddAsync(candidate2);
                var res = await candidateRepo.GetApprovedCandidates();

                //Assert
                res.Count.Should().Be(1);
            });
        }