コード例 #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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #13
0
        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);
 }
コード例 #17
0
        public HandlerResolverSetup HandlerThrows(Exception exception)
        {
            Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(o => throw exception);

            return(this);
        }
コード例 #18
0
        public HandlerResolverSetup ResolvesDummyHandler()
        {
            Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(o => Task.FromResult(0L));

            return(this);
        }
コード例 #19
0
        public HandlerResolverSetup ResolvesHandler(Func <object, Task <long> > handler)
        {
            Moq.Setup(x => x.ResolveHandlerFor(It.IsAny <object>())).Returns(handler);

            return(this);
        }