Esempio n. 1
0
        public EmbedBuilder AddField(Action <EmbedFieldBuilder> action)
        {
            var field = new EmbedFieldBuilder();

            action(field);
            _fields.Add(field.ToModel());
            return(this);
        }
Esempio n. 2
0
        public EmbedBuilder AddInlineField(string name, object value)
        {
            var field = new EmbedFieldBuilder()
                        .WithIsInline(true)
                        .WithName(name)
                        .WithValue(value);

            _fields.Add(field);
            return(this);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public EmbedBuilder AddField(EmbedFieldBuilder field)
 {
     _fields.Add(field);
     return(this);
 }