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; }
public virtual void SetUp() { _jsonSerializer = _jsonSerializer.Fake(); _webRequestSender = _webRequestSender.Fake(); _knownUserDataService = _knownUserDataService.Fake(); _knownUserFromGoogleUserBuilder = _knownUserFromGoogleUserBuilder.Fake(); _sut = new GoogleUserDataService(_webRequestSender, _jsonSerializer, _knownUserFromGoogleUserBuilder, _knownUserDataService); }
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)); }
public FindSmokeBall(IWebRequestSender webRequestSender, IHtmlParser htmlParser) { _webRequestSender = webRequestSender; _htmlParser = htmlParser; }
public WebRequestHandler(IJsonConverter jsonConverter, IWebRequestSender webRequestSender) : this() { JsonConverter = jsonConverter; WebRequestSender = webRequestSender; }