Exemplo n.º 1
0
 public void Should_throw_exception_when_required_argument_isnot_provided()
 {
     IArgumentMapFactory mapFactory = new ArgumentMapFactory();
     RequiredPropertyClass someClass = new RequiredPropertyClass();
     IArgumentMap map = mapFactory.CreateMap(someClass);
     map.ApplyTo(someClass, new List<IArgument>());
 }
Exemplo n.º 2
0
        public void A_string_value_should_be_stored_as_a_string()
        {
            List<IArgument> arguments = new List<IArgument>();
            arguments.Add(new Argument("one"));

            StringClass sc = new StringClass();

            IArgumentMapFactory mapFactory = new ArgumentMapFactory();

            IArgumentMap map = mapFactory.CreateMap(sc);

            map.ApplyTo(sc, arguments);

            Assert.That(sc.Value, Is.EqualTo("one"));
        }
Exemplo n.º 3
0
        public void A_boolean_value_should_be_converted_from_a_string()
        {
            List<IArgument> arguments = new List<IArgument>();
            arguments.Add(new Argument("true"));

            BooleanClass bc = new BooleanClass();

            IArgumentMapFactory mapFactory = new ArgumentMapFactory();

            IArgumentMap map = mapFactory.CreateMap(bc);

            map.ApplyTo(bc, arguments);

            Assert.That(bc.Value, Is.True);
        }