예제 #1
0
        public void Test2()
        {
            var script = NRecord
                         .RandomDomain()
                         .Name("TRecord")
                         .HiddenNamespace()
                         .Public()
                         .RecordProperty <string>("P1")
                         .RecordProperty <int>("P2")
                         .Script;

            Assert.Contains(@$ "public record TRecord{{{Environment.NewLine}public System.String P1{{{Environment.NewLine}get;{Environment.NewLine}init;{Environment.NewLine}}}{Environment.NewLine}public System.Int32 P2{{{Environment.NewLine}get;{Environment.NewLine}init;{Environment.NewLine}}}{Environment.NewLine}}}", script);
        }
예제 #2
0
        public void Test3()
        {
            var script = NRecord
                         .RandomDomain()
                         .Name("TRecord")
                         .HiddenNamespace()
                         .SkipInit()
                         .Public()
                         .RecordProperty <string>("P1")
                         .RecordProperty <int>("P2")
                         .Script;

            Assert.Contains(@$ "SkipLocalsInit", script);
        }