public void ShouldContructObjectWithParameterShort() { var dic = new Dictionary <string, string> { { "f1", "123" } }; var myObject = new Instantiator().Bind <My <short> >(dic); Assert.AreEqual(My.Create((Int16)123), myObject); }
public void ShouldContructObjectWithParameterChar() { var dic = new Dictionary <string, string> { { "f1", "a" } }; var myObject = new Instantiator().Bind <My <char> >(dic); Assert.AreEqual(My.Create('a'), myObject); }
public void ShouldContructObjectWithParameterBoolean() { var dic = new Dictionary <string, string> { { "f1", "true" } }; var myObject = new Instantiator().Bind <My <bool> >(dic); Assert.AreEqual(My.Create(true), myObject); }
public void ShouldContructObjectWithParameterEnumFromString() { var dic = new Dictionary <string, string> { { "f1", "Asdrubal" } }; var myObject = new Instantiator().Bind <My <E> >(dic); Assert.AreEqual(My.Create(E.Asdrubal), myObject); }
public void ShouldContructObjectWithNonPrimitiveParameter() { var dic = new Dictionary <string, string> { { "f1.f1", "asdf" } }; var myObject = new Instantiator().Bind <My <My <string> > >(dic); Assert.AreEqual(My.Create(My.Create("asdf")), myObject); }
public void ShouldContructObjectWithParameterDouble() { var dic = new Dictionary <string, string> { { "f1", "99.12345" } }; var myObject = new Instantiator().Bind <My <double> >(dic); Assert.AreEqual(My.Create(99.12345), myObject); }