public EventCentricTestSpecificationRunnerSetup SpecificationRunPassesWithEvents(Fact[] events) { Moq.Setup(x => x.Run(It.IsAny <EventCentricTestSpecification>())) .Returns <EventCentricTestSpecification>(spec => spec.Pass(events)); return(this); }
public EventCentricTestSpecificationRunnerSetup SpecificationRunFailsWithException(Exception exception) { Moq.Setup(x => x.Run(It.IsAny <EventCentricTestSpecification>())) .Returns <EventCentricTestSpecification>(spec => spec.Fail(exception)); return(this); }
public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunPasses(Exception exception) { Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>())) .Returns <ExceptionCentricTestSpecification>(spec => spec.Pass(exception)); return(this); }
public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunFails() { Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>())) .Returns <ExceptionCentricTestSpecification>(spec => spec.Fail()); return(this); }
public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunFailsBecauseEvents(Fact[] events) { Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>())) .Returns <ExceptionCentricTestSpecification>(spec => spec.Fail(events)); return(this); }
internal LatestQueriesSetup LatestGemeentesExist(IEnumerable <MunicipalityLatestItem> gemeentes) { When($"[{gemeentes.Count()}] gemeentes exist\r\n[{gemeentes.ToLoggableString(LogFormatting)}]"); Moq.Setup(m => m.GetAllLatestMunicipalities()).Returns(gemeentes.AsQueryable()); return(this); }
internal KadRrServiceSetup AdresMappingExistsFor(IEnumerable <AddressDetailItem> adressen, string huisnummer, string index, string rrStraatcode, string postcode) { When($"rr adres mapping exists for huisnummer [{huisnummer}], index [{index}], rrStraatcode [{rrStraatcode}] and postcode[{postcode}]\r\n[{adressen.ToLoggableString(LogFormatting)}]"); Moq.Setup(m => m.GetAddressesBy(huisnummer, index, rrStraatcode, postcode)).Returns(adressen); return(this); }
internal KadRrServiceSetup StraatnamenExistForKadStraatcodeAndNISCode(IEnumerable <StreetNameLatestItem> straatnamen, string kadStraatCode, string nisCode) { When($"[{straatnamen.Count()}] straatnamen exist for kadStraatcode [{kadStraatCode}] and nisCode[{nisCode}]\r\n{straatnamen.ToLoggableString(LogFormatting)}"); Moq.Setup(m => m.GetStreetNamesByKadStreet(kadStraatCode, nisCode)).Returns(straatnamen); return(this); }
internal KadRrServiceSetup StraatnaamExistsForRrStraatcodeAndPostcode(StreetNameLatestItem straatnaam, string rrStraatcode, string postcode) { When($"straatnaam exists for rrStraatcode [{rrStraatcode}] and postcode[{postcode}]\r\n[{straatnaam.ToLoggableString(LogFormatting)}]"); Moq.Setup(m => m.GetStreetNameByRrStreet(rrStraatcode, postcode)).Returns(straatnaam); return(this); }
internal LatestQueriesSetup LatestAdressenExist(IEnumerable <AddressDetailItem> adressen, string straatnaamId, string huisnummer, string busnummer) { When($"[{adressen.Count()}] adressen exist for straatnaamId [{straatnaamId}], huisnummer [{huisnummer}] and busnummer [{busnummer}]\r\n{adressen.ToLoggableString(LogFormatting)}"); Moq.Setup(m => m.GetLatestAddressesBy(straatnaamId, huisnummer, busnummer)).Returns(adressen.AsQueryable()); return(this); }
internal LatestQueriesSetup InterceptingLatestAdresQuery(Action <string, string, string> callback, IEnumerable <AddressDetailItem> returnResult) { When("intercepting the adres search query"); Moq.Setup(m => m.GetLatestAddressesBy(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(returnResult.AsQueryable()).Callback(callback); return(this); }
internal LatestQueriesSetup LatestStraatnamenExistForGemeentenaam(IEnumerable <StreetNameLatestItem> straatnamen, string gemeentenaam) { When($"[{straatnamen.Count()}] straatnamen exist for gemeentenaam [{gemeentenaam}]\r\n[{straatnamen.ToLoggableString(LogFormatting)}]"); Moq.Setup(m => m.GetLatestStreetNamesBy(new[] { gemeentenaam })).Returns(straatnamen.AsQueryable()); Moq.Setup(m => m.GetAllLatestStreetNames()).Returns(straatnamen.AsQueryable()); foreach (StreetNameLatestItem straatnaam in straatnamen) { Moq.Setup(m => m.FindLatestStreetNameById(straatnaam.PersistentLocalId)).Returns(straatnaam); } return(this); }
public FactReaderSetup EventsExist(Fact[] events) { Moq.Setup(x => x.RetrieveFacts(It.IsAny <long>())).Returns(Task.FromResult(events)); return(this); }
internal LatestQueriesSetup LatestPostInfo(IEnumerable <PostalInfoLatestItem> postalInfos) { Moq.Setup(x => x.GetAllPostalInfo()).Returns(postalInfos); return(this); }
internal LatestQueriesSetup LatestStraatNamen(IEnumerable <StreetNameLatestItem> streetNames) { Moq.Setup(x => x.GetAllLatestStreetNames()).Returns(streetNames); return(this); }
internal LatestQueriesSetup LatestGemeentes(IEnumerable <MunicipalityLatestItem> gemeentes) { Moq.Setup(x => x.GetAllLatestMunicipalities()).Returns(gemeentes); return(this); }
public HandlerResolverSetup HandlerThrows(Exception exception) { Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(o => throw exception); return(this); }
public HandlerResolverSetup ResolvesDummyHandler() { Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(o => Task.FromResult(0L)); return(this); }
public HandlerResolverSetup ResolvesHandler(Func <object, Task <long> > handler) { Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(handler); return(this); }