public void NonAutoNullBodyTest() { var generator = new GetBodyGenerator(); var bodyData = new BodyData() { IsAuto = false, Body = "" }; Assert.Throws(typeof(InvalidOperationException), () => generator.Generate(bodyData)); }
public void AutoBodyTest() { var generator = new GetBodyGenerator(); var bodyData = new BodyData() { IsAuto = true, Body = "ShouldBeIgnored" }; var result = generator.Generate(bodyData); Assert.AreEqual("get;", result); }
public void NonAutoBodyTest() { var generator = new GetBodyGenerator(); var bodyData = new BodyData() { IsAuto = false, Body = "return 0;" }; var result = generator.Generate(bodyData); Assert.AreEqual(@"get { return 0; }", result); }
public void InvalidDataTypeTest() { var generator = new GetBodyGenerator(); Assert.Throws(typeof(InvalidOperationException), () => generator.Generate(123)); }
public void NullDataTest() { var generator = new GetBodyGenerator(); Assert.Throws(typeof(ArgumentNullException), () => generator.Generate(null)); }