public void CanConvertFrom() { var c = new BindingTypeConverter(); Assert.That(c.CanConvertFrom(typeof(string)), Is.True); Assert.That(c.CanConvertFrom(typeof(int)), Is.False); }
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)); }
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"); }
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)"); }