public async Task CreateMethod() { // arrange var sb = new StringBuilder(); var writer = new CodeWriter(sb); // act await InterfaceMethodBuilder.New() .SetName("GetAbc") .BuildAsync(writer); // assert sb.ToString().MatchSnapshot(); }
public async Task CreateMethod_With_One_Parameter() { // arrange var sb = new StringBuilder(); var writer = new CodeWriter(sb); // act await InterfaceMethodBuilder.New() .SetName("GetAbc") .AddParameter(ParameterBuilder.New().SetName("abc").SetType("String")) .BuildAsync(writer); // assert sb.ToString().MatchSnapshot(); }
public async Task Create_Interface_With_Property_Method() { // arrange var sb = new StringBuilder(); var writer = new CodeWriter(sb); // act await InterfaceBuilder.New() .SetName("IMarker") .AddProperty(InterfacePropertyBuilder.New() .SetName("Property1") .SetType("Bar")) .AddMethod(InterfaceMethodBuilder.New() .SetName("Method1") .SetReturnType("Bar")) .BuildAsync(writer); // assert sb.ToString().MatchSnapshot(); }