Ejemplo n.º 1
0
        /// <inheritdoc/>
        public NSDictionary ToDictionary()
        {
            var dict = new NSDictionary();

            dict.Add(nameof(this.Request), this.Request);
            dict.AddWhenNotNull(nameof(this.EntryName), this.EntryName);
            dict.AddWhenNotNull(nameof(this.EntryClass), this.EntryClass);
            dict.AddWhenNotNull(nameof(this.WaitForDisconnect), this.WaitForDisconnect);
            return(dict);
        }
Ejemplo n.º 2
0
        public void AddWhenNotNull_Works()
        {
            var dict = new NSDictionary();

            dict.AddWhenNotNull("null", null);
            dict.AddWhenNotNull("notnull", string.Empty);

            var key = Assert.Single(dict.Keys);

            Assert.Equal("notnull", key);
        }