Ejemplo n.º 1
0
            public StreetLightingDataServiceNegativeTests()
            {
                _surveyDetails = new SurveyDetails
                {
                    Name         = "nameStub",
                    EmailAddress = "*****@*****.**",
                    Address      = new SurveyAddress
                    {
                        AddressLine1 = "addressLine1Stub",
                        AddressLine2 = null,
                        City         = "cityStub",
                        PostCode     = "postCodeStub"
                    },
                    Satisfied  = true,
                    Brightness = 1
                };

                _mockRespondentDBSet         = new Mock <DbSet <Respondent> >();
                _mockStreetLightingDBContext = new Mock <StreetLightingDBContext>();
                _mockStreetLightingDBContext.Setup(m => m.Respondent).Throws(new Exception("MockedException"));
                _mockMapper = new Mock <IMapper>();
                _mockMapper.Setup(m => m.Map <Respondent>(_surveyDetails)).Returns(It.IsAny <Respondent>());
                _streetLightingDataService = new StreetLightingDataService(_mockStreetLightingDBContext.Object, _mockMapper.Object);
            }
Ejemplo n.º 2
0
 public StreetLightingController(IStreetLightingDataService streetLightingDataService, IMapper mapper)
 {
     _streetLightingDataService = streetLightingDataService;
     _mapper = mapper;
 }