예제 #1
0
        public async Task Create_ReadOnly_Property()
        {
            // arrange
            var sb     = new StringBuilder();
            var writer = new CodeWriter(sb);

            // act
            await InterfacePropertyBuilder.New()
            .SetName("Foo")
            .SetType("Bar")
            .BuildAsync(writer);

            // assert
            sb.ToString().MatchSnapshot();
        }
예제 #2
0
        public async Task Create_Interface_With_Property()
        {
            // arrange
            var sb     = new StringBuilder();
            var writer = new CodeWriter(sb);

            // act
            await InterfaceBuilder.New()
            .SetName("IMarker")
            .AddProperty(InterfacePropertyBuilder.New()
                         .SetName("Property1")
                         .SetType("Bar"))
            .BuildAsync(writer);

            // assert
            sb.ToString().MatchSnapshot();
        }
예제 #3
0
 public InterfaceBuilder AddProperty(InterfacePropertyBuilder property)
 {
     _properties.Add(property);
     return(this);
 }