public void GetProfileEmail_ValidEmail_ProfileReturned() { //Arrange const string ValidEmail = "*****@*****.**"; var jsonProfiles = Properties.Resources.JsonProfiles; Mock<IHttpTransport> httpTransportMock = new Mock<IHttpTransport>(MockBehavior.Strict); httpTransportMock.Setup(httpTransport => httpTransport.Request(It.IsAny<string>(), It.IsAny<ContentType>(), It.IsIn("GET", "POST"), null, It.IsAny<IEnumerable<Header>>())) .Returns(jsonProfiles); //Action NextCallerClient client = new NextCallerClient(httpTransportMock.Object); string profiles = client.GetByEmailJson(ValidEmail); //Assert httpTransportMock.Verify(httpTransport => httpTransport.Request(It.IsAny<string>(), It.IsAny<ContentType>(), It.IsIn("GET", "POST"), null, It.IsAny<IEnumerable<Header>>()), Times.Once); Assert.IsNotNull(profiles); Assert.AreEqual(profiles, jsonProfiles); }