Exemple #1
0
        public FindSmokeBallTest()
        {
            var webRequestSenderMock = new Mock <IWebRequestSender>();

            webRequestSenderMock.Setup(x => x.Get(It.IsAny <string>()))
            .Returns("");

            _webRequestSender = webRequestSenderMock.Object;

            var htmlParserMock = new Mock <IHtmlParser>();

            htmlParserMock.Setup(x => x.GetMatchIndices(It.IsAny <Regex>()))
            .Returns(new List <int> {
                1000, 2000, 3000
            });
            htmlParserMock.Setup(x => x.ReadDivAtIndex(1000))
            .Returns("<div></div>");
            htmlParserMock.Setup(x => x.ReadDivAtIndex(2000))
            .Returns("<div>www.smokeball.com.au</div>");
            htmlParserMock.Setup(x => x.ReadDivAtIndex(3000))
            .Returns("<div></div>");
            htmlParserMock.Setup(x => x.SetHtml(It.IsAny <string>()));

            _htmlParser = htmlParserMock.Object;
        }
Exemple #2
0
 public virtual void SetUp()
 {
     _jsonSerializer                 = _jsonSerializer.Fake();
     _webRequestSender               = _webRequestSender.Fake();
     _knownUserDataService           = _knownUserDataService.Fake();
     _knownUserFromGoogleUserBuilder = _knownUserFromGoogleUserBuilder.Fake();
     _sut = new GoogleUserDataService(_webRequestSender, _jsonSerializer, _knownUserFromGoogleUserBuilder, _knownUserDataService);
 }
Exemple #3
0
 public GoogleUserDataService(
     IWebRequestSender webRequestSender,
     IJsonSerializer jsonSerializer,
     IKnownUserFromGoogleUserBuilder knownUserFromGoogleUserBuilder,
     IKnownUserDataService knownUserDataService)
 {
     _knownUserDataService           = knownUserDataService ?? throw new ArgumentNullException(nameof(knownUserDataService));
     _knownUserFromGoogleUserBuilder = knownUserFromGoogleUserBuilder ?? throw new ArgumentNullException(nameof(knownUserFromGoogleUserBuilder));
     _webRequestSender = webRequestSender ?? throw new ArgumentNullException(nameof(webRequestSender));
     _jsonSerializer   = jsonSerializer ?? throw new ArgumentNullException(nameof(jsonSerializer));
 }
Exemple #4
0
 public FindSmokeBall(IWebRequestSender webRequestSender, IHtmlParser htmlParser)
 {
     _webRequestSender = webRequestSender;
     _htmlParser       = htmlParser;
 }
Exemple #5
0
 public WebRequestHandler(IJsonConverter jsonConverter, IWebRequestSender webRequestSender) : this()
 {
     JsonConverter    = jsonConverter;
     WebRequestSender = webRequestSender;
 }