public void Get_InvokeService_ReturnTemplate()
        {
            //Arrange
            Template template = new Template();

            template.Id          = new Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4");
            template.Name        = "Test";
            template.Description = "Test Description";

            //Moq
            Mock <IFinderService <Template> > finderService = new Mock <IFinderService <Template> >();
            MapperConfiguration mapperconfig = new MapperConfiguration(_mapper =>
            {
                _mapper.CreateMap <Template, TemplateViewModel>();
            });

            IMapper mapper = mapperconfig.CreateMapper();

            finderService.Setup((_finderService) => _finderService.Get(template.Id)).Returns(template);

            //SUT
            var SUT    = new ClassFinderViewModelService(mapper, finderService.Object);
            var result = SUT.Get(template.Id);

            //Assert
            Assert.NotNull(result);
        }
        public void Get_ConvertEntity_ConvertSuccessful()
        {
            //Arrange
            Template template = new Template();

            template.Id = new Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4");
            TemplateViewModel templateViewModel = new TemplateViewModel();

            //Mock
            Mock <IFinderService <Template> > finderService = new Mock <IFinderService <Template> >();
            Mock <IMapper> mapper = new Mock <IMapper>();

            finderService.Setup((service) => service.Get(template.Id)).Returns(template);
            mapper.Setup((map) => map.Map <TemplateViewModel>(template)).Returns(templateViewModel);

            //Act
            var SUT    = new ClassFinderViewModelService(mapper.Object, finderService.Object);
            var result = SUT.Get(template.Id);

            //Assert
            Assert.IsType <TemplateViewModel>(result);
        }
        public void Get_InvokeService_ReturnTemplateEmpty()
        {
            //Arrange
            var id = new Guid("00000000-0000-0000-0000-000000000000");

            //Mock
            Mock <IFinderService <Template> > finderService = new Mock <IFinderService <Template> >();
            MapperConfiguration mapperconfig = new MapperConfiguration(_mapper =>
            {
                _mapper.CreateMap <Template, TemplateViewModel>();
            });
            IMapper mapper = mapperconfig.CreateMapper();

            finderService.Setup((_finderService) => _finderService.Get(id));

            //SUT
            var SUT = new ClassFinderViewModelService(mapper, finderService.Object);

            //Act
            var templateFound = SUT.Get(id);

            //Assert
            Assert.Null(templateFound);
        }