public void By_default_any_type_as_key_is_supported() { var arguments = new Arguments(new CustomStringComparer()); var key = new object(); var value = "foo"; arguments.Add(key, value); Assert.AreEqual("foo", arguments[key]); }
public void Custom_stores_get_picked_over_default_ones() { var arguments = new Arguments(new CustomStringComparer()); var key = "foo"; var value = new object(); arguments.Add(key, value); Assert.AreEqual(value, arguments["boo!"]); }
public void ShouldBeAbleToSupplyValueForNullableParam() { var container = new WindsorContainer(); container.Register(Component.For<ClassTakingNullable>()); var arguments = new Arguments().Insert("SomeVal", 5); var s = container.Resolve<ClassTakingNullable>(arguments); Assert.IsNotNull(s.SomeVal); }
public void Handles_string_as_key_case_insensitive() { var arguments = new Arguments(); var key = "foo"; var value = new object(); arguments.Add(key, value); Assert.IsTrue(arguments.Contains(key.ToLower())); Assert.IsTrue(arguments.Contains(key.ToUpper())); }
public void Handles_string_as_key() { var arguments = new Arguments(); var key = "Foo"; var value = new object(); arguments.Add(key, value); Assert.AreEqual(1, arguments.Count); Assert.IsTrue(arguments.Contains(key)); Assert.AreSame(value, arguments[key]); }