public void TestThatLoginIsUnSuccessfullIfResponseIsEmpty() { string response = null; _webRequest.Setup(w => w.GetResponse(It.IsAny <string>(), new byte[] { It.IsAny <byte>() }, It.IsAny <string>(), It.IsAny <string>())); _webRequest.SetReturnsDefault(response); var testLoginXmlApiService = new TestLoginXmlApiService(_apiSettings, _webRequest.Object); var exception = Assert.Throws <XmlApiLoginException>(() => testLoginXmlApiService.Test()); Assert.AreEqual("Xml APi test is failed", exception.Message); }
public void TestThatLoginIsUnSuccessfull() { var response = @"<WFC> <Response Status='Failed' Timeout='1800' PersonNumber='SUPERUSER' Action='Logon' PersonKey='-1' Username='******' Object='System'></Response></WFC>"; _webRequest.Setup(w => w.GetResponse(It.IsAny <string>(), new byte[] { It.IsAny <byte>() }, It.IsAny <string>(), It.IsAny <string>())); _webRequest.SetReturnsDefault(response); var testLoginXmlApiService = new TestLoginXmlApiService(_apiSettings, _webRequest.Object); var result = testLoginXmlApiService.Test(); Assert.AreEqual(false, result); }