Example #1
0
        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.");
            }
        }
Example #2
0
 public void TestGetData()
 {
     IService1 service = new Service1();
     Assert.IsTrue(service.GetData(1234).Contains("1234"));
 }