Ejemplo n.º 1
0
        public async Task Shoud_Add_CandidateTest_In_CandidateService()
        {
            var candidate = new Candidate()
            {
                FirstName = "Minamba",
                LastName  = "Camara",
                Test      = new TestModel()
                {
                    Title = "c#"
                }
            };

            var mockRepository = Substitute.For <ICandidatesRepository>();
            var logger         = Substitute.For <ILog>();

            mockRepository.AddCandidateTestAsync(candidate).Returns(candidate);
            var candidateService = new CandidatesService(mockRepository, logger);
            var result           = await candidateService.AddCandidateTestAsync(candidate);

            Assert.AreEqual(candidate, result);
        }