コード例 #1
0
        public void CanConvertFrom()
        {
            var c = new BindingTypeConverter();

            Assert.That(c.CanConvertFrom(typeof(string)), Is.True);
            Assert.That(c.CanConvertFrom(typeof(int)), Is.False);
        }
コード例 #2
0
        public void Convert()
        {
            var c       = new BindingTypeConverter();
            var binding = c.ConvertFromInvariantString("Path");

            Assert.That(binding, Is.InstanceOf <Binding>());
            Assert.That(((Binding)binding).Path, Is.EqualTo("Path"));
            Assert.That(((Binding)binding).Mode, Is.EqualTo(BindingMode.Default));
        }
コード例 #3
0
        public void BindingTypeConverterConstructor()
        {
            tlog.Debug(tag, $"BindingTypeConverterConstructor START");
            Type type = typeof(string);
            BindingTypeConverter t2 = new BindingTypeConverter();

            Assert.IsNotNull(t2, "null BindingTypeConverter");
            Assert.IsInstanceOf <BindingTypeConverter>(t2, "Should return BindingTypeConverter instance.");
            tlog.Debug(tag, $"BindingTypeConverterConstructor END");
        }
コード例 #4
0
 public void ConvertFromInvariantStringTest()
 {
     tlog.Debug(tag, $"ConvertFromInvariantStringTest START");
     try
     {
         BindingTypeConverter t2 = new BindingTypeConverter();
         Assert.IsNotNull(t2, "null BindingTypeConverter");
         var b = t2.ConvertFromInvariantString("Binding");
         Assert.IsNotNull(b, "null Binding");;
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"ConvertFromInvariantStringTest END (OK)");
 }