public void TestGetDataUsingDataContract() { IService1 service = new Service1(); CompositeType data = new CompositeType() { BoolValue = true, StringValue = "Good", }; CompositeType result = service.GetDataUsingDataContract(data); Assert.AreEqual("GoodSuffix", result.StringValue); data = new CompositeType() { BoolValue = false, StringValue = "Good", }; result = service.GetDataUsingDataContract(data); Assert.AreEqual("Good", result.StringValue); try { result = service.GetDataUsingDataContract(null); Assert.Fail("Hey, I expect ArgumentNullException."); } catch (ArgumentNullException) { Assert.IsTrue(true, "Very good, excepted."); } }
public void TestGetData() { IService1 service = new Service1(); Assert.IsTrue(service.GetData(1234).Contains("1234")); }