Skip to content

Instantly share code, notes, and snippets.

@dtchepak
Created October 19, 2012 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtchepak/3921307 to your computer and use it in GitHub Desktop.
Save dtchepak/3921307 to your computer and use it in GitHub Desktop.
ShouldNotReturnNullWebServiceResponse
[Test]
public void ShouldNotReturnNullWebServiceResponse()
{
var iv_client = Substitute.For<Client>();
iv_client.GetValuation("G1|12345", 10000, 2008, "08").Returns(new WebServiceResponse()
{
Result = false,
ErrorEnum = IdResponseCode.NoDataFound
});
Assert.NotNull(iv_client.GetValuation("G1|12345", 10000, 2008, "08"));
}
public interface Client { WebServiceResponse GetValuation(string g1, int i, int i1, string s); }
public enum IdResponseCode { NoDataFound, }
public class WebServiceResponse
{
public bool Result { get; set; }
public IdResponseCode ErrorEnum { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment