コード例 #1
0
        public void CanUpdateSettings()
        {
            var fetcher = new BuildDataFetcher(new ViewUrl("http://bla"),
                                               new ConfigSettings
            {
                URL = "http://bla"
            }, _webClientFactory);

            fetcher.Fetch();
            _webClient.AssertWasCalled(w => w.DownloadString(Arg <string> .Is.Equal(new Uri("http://bla"))), w => w.Repeat.Once());

            fetcher.ConfigUpdated(new ConfigSettings {
                URL = "http://new"
            });
            fetcher.Fetch();
            _webClient.AssertWasCalled(w => w.DownloadString(Arg <string> .Is.Equal(new Uri("http://new"))), w => w.Repeat.Once());
        }
コード例 #2
0
            public TestHarness VerifyWebClientWasCalled(int numberOfTimes)
            {
                _mockWebClient
                .AssertWasCalled(x =>
                                 x.GetHtmlAsync(
                                     Arg.Is(_fakeUrl),
                                     Arg <CancellationToken> .Is.Anything),

                                 options => options.Repeat.Times(numberOfTimes));

                return(this);
            }