Exemplo n.º 1
0
        public void DeleteTimeReport_SuccessTest(RegistriesDelete registries)
        {
            //Arrange
            List <Registry>            weekRegistries   = GetTestRegistries();
            Mock <IRegistryRepository> registryRepoMock = new Mock <IRegistryRepository>();

            registryRepoMock.Setup(r => r.GetById(1)).Returns(weekRegistries[0]);
            registryRepoMock.Setup(r => r.GetById(2)).Returns(weekRegistries[1]);
            registryRepoMock.Setup(r => r.GetById(3)).Returns(weekRegistries[2]);

            registryRepoMock.Setup(r => r.Delete(It.IsAny <object>())).Callback <object>(regId => weekRegistries.RemoveAll(reg => reg.RegistryId == (int)regId));
            registryRepoMock.Setup(r => r.Save());

            Mock <IUnitOfWork> mockUOF = new Mock <IUnitOfWork>();

            mockUOF.Setup(uow => uow.RegistryRepository).Returns(registryRepoMock.Object);

            var controller = new ReportingController(mockUOF.Object, httpContextAccessorMock);

            //Act
            var result = controller.DeleteTimeReport(registries);

            //Assert
            Assert.IsType <ActionResult <HttpResponse> >(result);
            Assert.Equal((int)HttpStatusCode.OK, (result.Result as StatusCodeResult).StatusCode);
            Assert.Empty(weekRegistries);
            registryRepoMock.Verify(r => r.Delete(It.IsAny <object>()), Times.Exactly(3));
            registryRepoMock.Verify(r => r.Save(), Times.Once);
        }
Exemplo n.º 2
0
        public void VerifyBeginTransaction(Times? times = null)
        {
            if (times == null)
                times = Times.Once();

            mockSession.Verify(x => x.BeginTransaction(), times.Value);
        }
Exemplo n.º 3
0
 public void CallCardinality_Moq(int times)
 {
     var b = new Mock<IMyB>();
     new MyA(b.Object).CallDependencyNTimes(times);
     b.Verify(x => x.DoSomething(), Times.Exactly(times));
     b.ResetCalls(); // Not Required
 }
Exemplo n.º 4
0
        public void VerifyCommitTransaction(Times? times = null)
        {
            if (times == null)
                times = Times.Once();

            mockTransaction.Verify(x => x.Commit(), times.Value);
        }
        private async Task VerifyWaitOccurredAsync(DateTime waitUntil, DateTime now, Times expectedTimes)
        {
            await _sut.UntilAsync(waitUntil, now);

            Mock.Get(_log).Verify(
                x => x.InfoFormat(It.IsAny<string>(), It.IsAny<string>()),
                expectedTimes);
        }
 public void AssertNumberOfGetPrompts(string name, Times exactly)
 {
     _promptsViewModelService
         .Verify
             (s => s.GetPromptViewModels(
                 name,
                 It.IsAny<Action<IEnumerable<IPrompt>>>(),
                 It.IsAny<Action<string>>())
             , exactly);
 }
Exemplo n.º 7
0
 public void AssertNumberOfGetChildren(
     string promptName
     , string parameterName
     , ITreeNode treeNode
     , Times times)
 {
     _childTreeNodeService.Verify(
         s => s.GetChildrenFor(
             promptName
             , parameterName
             , treeNode
             , It.IsAny<Action<ObservableCollection<ITreeNode>>>()), times);
 }
Exemplo n.º 8
0
        public async Task ThenItShouldSerializeRequests(DateTime changedSince)
        {
            await _client.GetProvidersChangedSinceAsync(changedSince, CancellationToken.None);

            _requestSerializer.Verify(serializer => serializer.Serialize(It.IsAny <ProviderQueryRequest>()),
                                      Times.Exactly(4));
            _requestSerializer.Verify(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(
                                                                             request => !string.IsNullOrEmpty(request.QueryId) &&
                                                                             request.SelectionCriteria != null &&
                                                                             request.SelectionCriteria.ProviderUpdatedSince == changedSince &&
                                                                             request.SelectionCriteria.CriteriaCondition == CriteriaConditionEnum.OR &&
                                                                             request.SelectionCriteria.ProviderStatus == ProviderStatusEnum.A &&
                                                                             request.SelectionCriteria.ApprovedProvidersOnly == ApprovedProvidersOnlyEnum.No &&
                                                                             request.SelectionCriteria.StakeholderId == _configuration.StakeholderId)),
                                      Times.Once);
            _requestSerializer.Verify(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(
                                                                             request => !string.IsNullOrEmpty(request.QueryId) &&
                                                                             request.SelectionCriteria != null &&
                                                                             request.SelectionCriteria.ProviderUpdatedSince == changedSince &&
                                                                             request.SelectionCriteria.CriteriaCondition == CriteriaConditionEnum.OR &&
                                                                             request.SelectionCriteria.ProviderStatus == ProviderStatusEnum.V &&
                                                                             request.SelectionCriteria.ApprovedProvidersOnly == ApprovedProvidersOnlyEnum.No &&
                                                                             request.SelectionCriteria.StakeholderId == _configuration.StakeholderId)),
                                      Times.Once);
            _requestSerializer.Verify(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(
                                                                             request => !string.IsNullOrEmpty(request.QueryId) &&
                                                                             request.SelectionCriteria != null &&
                                                                             request.SelectionCriteria.ProviderUpdatedSince == changedSince &&
                                                                             request.SelectionCriteria.CriteriaCondition == CriteriaConditionEnum.OR &&
                                                                             request.SelectionCriteria.ProviderStatus == ProviderStatusEnum.PD1 &&
                                                                             request.SelectionCriteria.ApprovedProvidersOnly == ApprovedProvidersOnlyEnum.No &&
                                                                             request.SelectionCriteria.StakeholderId == _configuration.StakeholderId)),
                                      Times.Once);
            _requestSerializer.Verify(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(
                                                                             request => !string.IsNullOrEmpty(request.QueryId) &&
                                                                             request.SelectionCriteria != null &&
                                                                             request.SelectionCriteria.ProviderUpdatedSince == changedSince &&
                                                                             request.SelectionCriteria.CriteriaCondition == CriteriaConditionEnum.OR &&
                                                                             request.SelectionCriteria.ProviderStatus == ProviderStatusEnum.PD2 &&
                                                                             request.SelectionCriteria.ApprovedProvidersOnly == ApprovedProvidersOnlyEnum.No &&
                                                                             request.SelectionCriteria.StakeholderId == _configuration.StakeholderId)),
                                      Times.Once);
        }
 private void TestSamples(int numSamples, Times numTimesEachByte, Times numTotalBytes)
 {
     SendHeader(numSamples);
     SendSamples(0, (byte)(numSamples * 2), numTimesEachByte, numTotalBytes);
 }
Exemplo n.º 10
0
 private void SendSamples(byte low, byte high, Times numTimesEachByte, Times numTotalBytes)
 {
     for (byte b = low; b < high; b++)
     {
         byteReceiver.byteReceived(b);
         mockSampleAssembler.Verify(x => x.AddReceivedByte(b), numTimesEachByte);
     }
     mockSampleAssembler.Verify(x => x.AddReceivedByte(It.IsAny<byte>()), numTotalBytes);
 }
Exemplo n.º 11
0
 public void AssertNumberOfCancels(string reportPath, Times times)
 {
     _promptsViewModelService.Verify(s => s.CancelGetPromptViewModels(reportPath), times);
 }
Exemplo n.º 12
0
 private void VerifyFetchEpisodeBrokenIndexer(Times times)
 {
     _brokenIndexer.Verify(v => v.FetchEpisode(It.IsAny<string>(), SEASON_NUMBER, It.IsAny<int>())
         , times);
 }
Exemplo n.º 13
0
        private void VerifyFetchDailyEpisode(Times times)
        {
            _episodeIndexer1.Verify(v => v.FetchDailyEpisode(_series.Title, It.IsAny<DateTime>())
                , times);

            _episodeIndexer2.Verify(v => v.FetchDailyEpisode(_series.Title, It.IsAny<DateTime>())
                , times);
        }
 /// <summary>
 /// Verifies that SimConnect was sent commands to unfreeze the aircraft and allow it to fly normally.
 /// </summary>
 /// <param name="times"></param>
 private void VerifyUnfreezeSent(Times times)
 {
     DoVerifyFreeze(false, times);
 }
Exemplo n.º 15
0
 public static void VerifyUpdateLastModificationDate(this Mock<IFolder> folder, DateTime modificationDate, Times times, bool refresh = true) {
     folder.Verify(d => d.UpdateProperties(It.Is<IDictionary<string, object>>(dic => VerifyDictContainsLastModification(dic, modificationDate)), refresh));
 }
Exemplo n.º 16
0
        public void GetWeekTemplates_SuccessTest(DateTime todaysDate)
        {
            //Arrange
            List <Registry> weekRegistries = GetTestRegistries();
            List <Mission>  missions       = GetTestMissions();
            List <Task>     tasks          = GetTestTasks();

            Mock <IRegistryRepository> registryRepoMock = new Mock <IRegistryRepository>();

            registryRepoMock.SetupSequence(r => r.GetRegistriesByDate(It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>()))
            .Returns(weekRegistries)
            .Returns(new List <Registry>())
            .Returns(new List <Registry>())
            .Returns(new List <Registry>())
            .Returns(new List <Registry>());

            Mock <IMissionRepository> missionRepoMock = new Mock <IMissionRepository>();

            missionRepoMock.Setup(r => r.GetById(1)).Returns(missions[0]);
            missionRepoMock.Setup(r => r.GetById(2)).Returns(missions[1]);

            Mock <ITaskRepository> taskRepoMock = new Mock <ITaskRepository>();

            taskRepoMock.Setup(r => r.GetById(1)).Returns(tasks[0]);
            taskRepoMock.Setup(r => r.GetById(2)).Returns(tasks[1]);

            Mock <IUnitOfWork> mockUOF = new Mock <IUnitOfWork>();

            mockUOF.Setup(uow => uow.RegistryRepository).Returns(registryRepoMock.Object);
            mockUOF.Setup(uow => uow.MissionRepository).Returns(missionRepoMock.Object);
            mockUOF.Setup(uow => uow.TaskRepository).Returns(taskRepoMock.Object);

            var controller = new ReportingController(mockUOF.Object, httpContextAccessorMock);

            //Act
            var result = controller.GetWeekTemplates(todaysDate);

            //Assert
            Assert.IsType <ActionResult <List <WeekTemplateViewModel> > >(result);
            registryRepoMock.Verify(r => r.GetRegistriesByDate(It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>()), Times.Exactly(5));
            Assert.Single(result.Value);
        }
 /// <summary>
 /// Verifies that SimConnect was asked to take FSX out of slew mode.
 /// </summary>
 /// <param name="times"></param>
 private void VerifySlewOffSent(Times times)
 {
     DoVerifySlew(false, times);
 }
Exemplo n.º 18
0
 private void PerformLoadVerificationTest(int? detailKey, Times loadInvocationTimes)
 {
     var args = new MockProjectInvocationRuleSetupArgs() {
         CanExecute = true,
         ProjectPath = "path",
         UsesInput = false
     };
     var d = new ProjectExecutionDetail() { Key = detailKey };
     var i = CreateItem(args, d);
     var rmMock = new Mock<IRuntimeManager>();
     var mre = new ManualResetEvent(false);
     i.BeginExecute(rmMock.Object, ei => mre.Set());
     mre.WaitOne(200);
     rmMock.Verify(m => m.Load(args.ProjectPath, It.IsAny<IStartupArgs>()), loadInvocationTimes);
 }
 private static void VerifyContenChangeHandlersRemoved(Mock<ISyncEventManager> manager, Times times) {
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<ContentChanges>()), times);
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<ContentChangeEventAccumulator>()), times);
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<IgnoreAlreadyHandledContentChangeEventsFilter>()), times);
 }
 private static void VerifyNonContenChangeHandlersRemoved(Mock<ISyncEventManager> manager, Times times) {
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<DescendantsCrawler>()), times);
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<RemoteObjectFetcher>()), times);
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<SyncMechanism>()), times);
     manager.Verify(m => m.RemoveEventHandler(It.IsAny<RemoteObjectMovedOrRenamedAccumulator>()), times);
 }
        /// <summary>
        /// Does the work for <see cref="VerifySlewOnSent"/> and <see cref="VerifySlewOffSent"/>.
        /// </summary>
        /// <param name="on"></param>
        /// <param name="times"></param>
        private void DoVerifySlew(bool on, Times times)
        {
            var slewModeOnEventId = _ClientEventIdMap["SLEW_ON"];
            var slewModeOffEventId = _ClientEventIdMap["SLEW_OFF"];
            var slewAltitudeUpSlowEventId = _ClientEventIdMap["SLEW_ALTIT_UP_SLOW"];
            var slewFreezeEventId = _ClientEventIdMap["SLEW_FREEZE"];

            var groupId = _NotificationGroupMap[slewModeOffEventId];

            if(!on) {
                _SimConnect.Verify(m => m.TransmitClientEvent(0U, slewModeOffEventId, 0u, groupId, 0), times);
            } else {
                _SimConnect.Verify(m => m.TransmitClientEvent(0U, slewModeOnEventId, 0u, groupId, 0), times);
                _SimConnect.Verify(m => m.TransmitClientEvent(0U, slewAltitudeUpSlowEventId, 0u, groupId, 0), times);
                _SimConnect.Verify(m => m.TransmitClientEvent(0U, slewFreezeEventId, 0u, groupId, 0), times);
            }
        }
 public static void VerifyCreateHttpWebRequest(this Mock<Facebook.FacebookClient> mockFb, Times times)
 {
     mockFb
         .Protected()
         .Verify("CreateHttpWebRequest", times, ItExpr.IsAny<Uri>());
 }
        public void ProcessLimitsTest(
      string configurationName,
      SLimits limits, 
      bool logStatistic, 
      int apiUsageThreshold, 
      int dataStorageThreshold,
      Times[] result)
        {
            var mockedApiDailyRequestsLoger = new Moq.Mock<ILimitLoger>();
              if (limits != null)
              {
            var apiDailyRequestsLoger = new ApiDailyRequestsLoger(configurationName, limits.DailyApiRequests);
            mockedApiDailyRequestsLoger.SetupGet(p => p.UsedAmount).Returns(apiDailyRequestsLoger.UsedAmount);
            mockedApiDailyRequestsLoger.SetupGet(p => p.UsedPercents).Returns(apiDailyRequestsLoger.UsedPercents);
              }

              mockedApiDailyRequestsLoger.Setup(m => m.LogPointWarning()).Verifiable();
              mockedApiDailyRequestsLoger.Setup(m => m.LogHasReachedError()).Verifiable();

              var mockedDataStorageLoger = new Moq.Mock<ILimitLoger>();
              if (limits != null)
              {
            var dataStorageLoger = new ApiDailyRequestsLoger(configurationName, limits.DataStorageMb);
            mockedDataStorageLoger.SetupGet(p => p.UsedAmount).Returns(dataStorageLoger.UsedAmount);
            mockedDataStorageLoger.SetupGet(p => p.UsedPercents).Returns(dataStorageLoger.UsedPercents);
              }

              mockedDataStorageLoger.Setup(m => m.LogPointWarning()).Verifiable();
              mockedDataStorageLoger.Setup(m => m.LogHasReachedError()).Verifiable();

              var mockedLoger = new Moq.Mock<ILimitsLoger>();
              mockedLoger.SetupGet(p => p.ApiDailyRequestsLoger).Returns(mockedApiDailyRequestsLoger.Object);
              mockedLoger.SetupGet(p => p.DataStorageLoger).Returns(mockedDataStorageLoger.Object);
              mockedLoger.Setup(m => m.LogStatisticInfo()).Verifiable();
              mockedLoger.Setup(m => m.LogInformationAreNotAvailableWarning()).Verifiable();

              var agent = new LimitsAgent();
              agent.LogStatistic = logStatistic;
              agent.ApiUsageThreshold = apiUsageThreshold;
              agent.DataStorageThreshold = dataStorageThreshold;
              var logerField = typeof(LimitsAgent).GetField("loger", BindingFlags.Instance | BindingFlags.NonPublic);
              if (logerField != null)
              {
            logerField.SetValue(agent, mockedLoger.Object);
              }

              agent.ProcessLimits(limits);

              mockedLoger.Verify(m => m.LogStatisticInfo(), result[0]);
              mockedLoger.Verify(m => m.LogInformationAreNotAvailableWarning(), result[1]);
              mockedApiDailyRequestsLoger.Verify(m => m.LogPointWarning(), result[2]);
              mockedApiDailyRequestsLoger.Verify(m => m.LogHasReachedError(), result[3]);
              mockedDataStorageLoger.Verify(m => m.LogPointWarning(), result[4]);
              mockedDataStorageLoger.Verify(m => m.LogHasReachedError(), result[5]);
        }
 /// <summary>
 /// Verifies that SimConnect was asked to put FSX into slew mode.
 /// </summary>
 /// <param name="times"></param>
 private void VerifySlewOnSent(Times times)
 {
     DoVerifySlew(true, times);
 }
        /// <summary>
        /// Does the work for <see cref="VerifyFreezeSent"/> and <see cref="VerifyUnfreezeSent"/>.
        /// </summary>
        /// <param name="freeze"></param>
        /// <param name="times"></param>
        private void DoVerifyFreeze(bool freeze, Times times)
        {
            var expectedValue = freeze ? 1U : 0U;

            var altitudeEventId = _ClientEventIdMap["FREEZE_ALTITUDE_SET"];
            var attitudeEventId = _ClientEventIdMap["FREEZE_ATTITUDE_SET"];
            var positionEventId = _ClientEventIdMap["FREEZE_LATITUDE_LONGITUDE_SET"];

            var groupId = _NotificationGroupMap[altitudeEventId];

            _SimConnect.Verify(m => m.TransmitClientEvent(0U, altitudeEventId, expectedValue, groupId, 0), times);
            _SimConnect.Verify(m => m.TransmitClientEvent(0U, attitudeEventId, expectedValue, groupId, 0), times);
            _SimConnect.Verify(m => m.TransmitClientEvent(0U, positionEventId, expectedValue, groupId, 0), times);
        }
Exemplo n.º 26
0
 private void VerifyFetchSeason(Times times)
 {
     _episodeIndexer1.Verify(v => v.FetchSeason(_series.Title, SEASON_NUMBER), times);
     _episodeIndexer1.Verify(v => v.FetchSeason(_series.Title, SEASON_NUMBER), times);
 }
 public void Verify(Expression<Action<ILogger>> action, Times times)
 {
     lock(this.lockObject)
     {
         this.wrappedMock.Verify(action, times);
     }
 }
        private static void VerifyErrorCount(Times count, Action<TaskQueueMonitor> test)
        {
            var connection = Mock.Of<IConnection>();

            using (var monitor = new TaskQueueMonitor(connection, Timeout.InfiniteTimeSpan))
            {
                test(monitor);
            }

            Mock.Get(connection)
                .Verify(c => c.OnError(It.Is<SlowCallbackException>(e => e.Message == _expectedErrorMessage)), count);
        }
Exemplo n.º 29
0
        private void VerifyFetchEpisodeWithSceneName(Times times)
        {
            _episodeIndexer1.Verify(v => v.FetchEpisode(SCENE_NAME, SEASON_NUMBER, It.IsAny<int>())
                , times);

            _episodeIndexer2.Verify(v => v.FetchEpisode(SCENE_NAME, SEASON_NUMBER, It.IsAny<int>())
                , times);
        }
 /// <summary>
 /// Verifies that SimConnect was used to send commands to FSX to freeze the aircraft and prevent it from moving.
 /// </summary>
 /// <param name="times"></param>
 private void VerifyFreezeSent(Times times)
 {
     DoVerifyFreeze(true, times);
 }
Exemplo n.º 31
0
        private void VerifyFetchPartialSeason(Times times)
        {
            _episodeIndexer1.Verify(v => v.FetchPartialSeason(_series.Title, SEASON_NUMBER, It.IsAny<int>())
                , times);

            _episodeIndexer2.Verify(v => v.FetchPartialSeason(_series.Title, SEASON_NUMBER, It.IsAny<int>())
                , times);
        }
 private void VerifyReadCalled( Times times )
 {
     this.readers.ForEach( readerMock => readerMock.Verify(
         r => r.Read( this.webResponseMock.Object ), times ) );
 }
 public static void VerifySavedMappedObject(
     this Mock<IMetaDataStorage> db,
     MappedObjectType type,
     string remoteId,
     string name,
     string parentId,
     string changeToken,
     Times times,
     bool extendedAttributeAvailable = true,
     DateTime? lastLocalModification = null,
     DateTime? lastRemoteModification = null,
     byte[] checksum = null,
     long contentSize = -1,
     bool ignored = false)
 {
     db.Verify(
         s =>
         s.SaveMappedObject(It.Is<IMappedObject>(o => VerifyMappedObject(o, type, remoteId, name, parentId, changeToken, extendedAttributeAvailable, lastLocalModification, lastRemoteModification, checksum, contentSize, ignored))),
         times);
 }
        public async Task Handle_WhenExecuteMutation_ShouldLogMutations()
        {
            var mutationRunLoggerManager = new Mock <IMutationRunLoggerManager>();
            var mutationDocumentExecutor = new ExecuteMutationsCommandHandler(_mutationExecutor, mutationRunLoggerManager.Object);

            await mutationDocumentExecutor.Handle(new ExecuteMutationsCommand(_config, _mutationDocuments), CancellationToken.None);

            mutationRunLoggerManager.Verify(m => m.LogAfterMutation(It.IsAny <MutationDocument>(), It.IsAny <List <MutationDocumentResult> >(), It.IsAny <int>()), Times.Exactly(3));
            mutationRunLoggerManager.Verify(m => m.LogBeforeMutation(It.IsAny <MutationDocument>()), Times.Exactly(3));
            mutationRunLoggerManager.Verify(m => m.LogBeforeRun(It.IsAny <List <MutationDocument> >()), Times.Once);
        }
Exemplo n.º 35
0
        public async Task ThenItShouldDeserializeResponses(
            string responseA,
            string responseV,
            string responsePd1,
            string responsePd2)
        {
            _requestSerializer
            .Setup(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(req => req.SelectionCriteria.ProviderStatus == ProviderStatusEnum.A)))
            .Returns("<ProviderStatus>A</ProviderStatus>");
            _httpClientMock
            .When(req => req.Content.ReadAsStringAsync().Result == "<ProviderStatus>A</ProviderStatus>")
            .Then(new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK, Content = new StringContent(responseA)
            });
            _requestSerializer
            .Setup(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(req => req.SelectionCriteria.ProviderStatus == ProviderStatusEnum.V)))
            .Returns("<ProviderStatus>V</ProviderStatus>");
            _httpClientMock
            .When(req => req.Content.ReadAsStringAsync().Result == "<ProviderStatus>V</ProviderStatus>")
            .Then(new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK, Content = new StringContent(responseV)
            });
            _requestSerializer
            .Setup(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(req => req.SelectionCriteria.ProviderStatus == ProviderStatusEnum.PD1)))
            .Returns("<ProviderStatus>PD1</ProviderStatus>");
            _httpClientMock
            .When(req => req.Content.ReadAsStringAsync().Result == "<ProviderStatus>PD1</ProviderStatus>")
            .Then(new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK, Content = new StringContent(responsePd1)
            });
            _requestSerializer
            .Setup(serializer => serializer.Serialize(It.Is <ProviderQueryRequest>(req => req.SelectionCriteria.ProviderStatus == ProviderStatusEnum.PD2)))
            .Returns("<ProviderStatus>PD2</ProviderStatus>");
            _httpClientMock
            .When(req => req.Content.ReadAsStringAsync().Result == "<ProviderStatus>PD2</ProviderStatus>")
            .Then(new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK, Content = new StringContent(responsePd2)
            });

            await _client.GetProvidersChangedSinceAsync(new DateTime(), CancellationToken.None);

            _responseDeserializer.Verify(deserializer => deserializer.DeserializeResponse(It.IsAny <string>()), Times.Exactly(4));
            _responseDeserializer.Verify(deserializer => deserializer.DeserializeResponse(responseA), Times.Once);
            _responseDeserializer.Verify(deserializer => deserializer.DeserializeResponse(responseV), Times.Once);
            _responseDeserializer.Verify(deserializer => deserializer.DeserializeResponse(responsePd1), Times.Once);
            _responseDeserializer.Verify(deserializer => deserializer.DeserializeResponse(responsePd2), Times.Once);
        }
Exemplo n.º 36
0
 public static void VerifySetContentStream(this Mock<IDocument> doc, Times times, bool overwrite = true, bool refresh = true, string mimeType = null) {
     doc.Verify(d => d.SetContentStream(It.Is<IContentStream>(s => VerifyContentStream(s, mimeType, doc.Object.Name)), overwrite, refresh), times);
 }