Пример #1
0
                public EventCentricTestSpecificationRunnerSetup SpecificationRunPassesWithEvents(Fact[] events)
                {
                    Moq.Setup(x => x.Run(It.IsAny <EventCentricTestSpecification>()))
                    .Returns <EventCentricTestSpecification>(spec => spec.Pass(events));

                    return(this);
                }
Пример #2
0
                public EventCentricTestSpecificationRunnerSetup SpecificationRunFailsWithException(Exception exception)
                {
                    Moq.Setup(x => x.Run(It.IsAny <EventCentricTestSpecification>()))
                    .Returns <EventCentricTestSpecification>(spec => spec.Fail(exception));

                    return(this);
                }
Пример #3
0
                public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunPasses(Exception exception)
                {
                    Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>()))
                    .Returns <ExceptionCentricTestSpecification>(spec => spec.Pass(exception));

                    return(this);
                }
Пример #4
0
                public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunFails()
                {
                    Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>()))
                    .Returns <ExceptionCentricTestSpecification>(spec => spec.Fail());

                    return(this);
                }
Пример #5
0
                public ExceptionCentricTestSpecificationRunnerSetup SpecificationRunFailsBecauseEvents(Fact[] events)
                {
                    Moq.Setup(x => x.Run(It.IsAny <ExceptionCentricTestSpecification>()))
                    .Returns <ExceptionCentricTestSpecification>(spec => spec.Fail(events));

                    return(this);
                }
Пример #6
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #14
0
 internal LatestQueriesSetup LatestPostInfo(IEnumerable <PostalInfoLatestItem> postalInfos)
 {
     Moq.Setup(x => x.GetAllPostalInfo()).Returns(postalInfos);
     return(this);
 }
Пример #15
0
 internal LatestQueriesSetup LatestStraatNamen(IEnumerable <StreetNameLatestItem> streetNames)
 {
     Moq.Setup(x => x.GetAllLatestStreetNames()).Returns(streetNames);
     return(this);
 }
Пример #16
0
 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);
        }