public LoginForm(Client client) { InitializeComponent(); _client = client; captchaPicture.Client = client; }
public ClientUnitTest() { var image = new Bitmap(20, 20); var captchaStream = new MemoryStream(); image.Save(captchaStream, ImageFormat.Bmp); _mockHttp.Setup(o => o.Get(CaptchaUrl)).Returns(captchaStream); _mockHttp.Setup(o => o.Post(It.IsAny<string>(), It.Is<string>(data => string.IsNullOrEmpty(data)))) .Returns(() => CreateStream("dummy\"dummy\"dummy\"4422")); _sut = new Client(_mockHttp.Object); }