示例#1
0
        public void AutoBodyTest()
        {
            var generator = new MethodBodyGenerator();
            var bodyData  = new BodyData()
            {
                IsAuto = true, Body = "ShouldBeIgnored"
            };
            var result = generator.Generate(bodyData);

            Assert.AreEqual(";", result);
        }
示例#2
0
        public void NonAutoNullBodyTest()
        {
            var generator = new MethodBodyGenerator();
            var bodyData  = new BodyData()
            {
                IsAuto = false, Body = ""
            };
            var result = generator.Generate(bodyData);

            Assert.AreEqual("{  }", result);
        }
示例#3
0
        public void InvalidDataTypeTest()
        {
            var generator = new MethodBodyGenerator();

            Assert.Throws(typeof(InvalidOperationException), () => generator.Generate(123));
        }
示例#4
0
        public void NullDataTest()
        {
            var generator = new MethodBodyGenerator();

            Assert.Throws(typeof(ArgumentNullException), () => generator.Generate(null));
        }