Beispiel #1
0
        public void Generates_Property_For_Custom_Scalar_DateTime()
        {
            var expected = FormatMemberTemplate(
                "DateTimeOffset? Foo { get; }",
                "public DateTimeOffset? Foo { get; }");

            var model = new TypeModel
            {
                Name   = "Entity",
                Kind   = TypeKind.Interface,
                Fields = new[]
                {
                    new FieldModel
                    {
                        Name = "foo",
                        Type = TypeModel.DateTime()
                    },
                }
            };

            var result = CodeGenerator.Generate(model, "Test", null);

            CompareModel("Entity.cs", expected, result);
        }