public EmbedBuilder AddField(Action <EmbedFieldBuilder> action) { var field = new EmbedFieldBuilder(); action(field); _fields.Add(field.ToModel()); return(this); }
public EmbedBuilder AddInlineField(string name, object value) { var field = new EmbedFieldBuilder() .WithIsInline(true) .WithName(name) .WithValue(value); _fields.Add(field); return(this); }
public void AddField_EmbedFieldBuilder() { var field = new EmbedFieldBuilder() .WithIsInline(true) .WithValue("value") .WithName("name"); var e = new EmbedBuilder() .AddField(field); Assert.Equal("name", e.Fields[0].Name); Assert.Equal("value", e.Fields[0].Value); Assert.True(e.Fields[0].IsInline); }
public void EmbedFieldBuilder() { var e = new EmbedFieldBuilder() .WithIsInline(true) .WithName("name") .WithValue("value"); Assert.Equal("name", e.Name); Assert.Equal("value", e.Value); Assert.True(e.IsInline); // use the properties e = new EmbedFieldBuilder(); e.IsInline = true; e.Name = "name"; e.Value = "value"; Assert.Equal("name", e.Name); Assert.Equal("value", e.Value); Assert.True(e.IsInline); }
public EmbedBuilder AddField(EmbedFieldBuilder field) { _fields.Add(field); return(this); }