SPRNET-1124

fixing broken build from inadvertent introduction of .NET 2.0 inline property initializers unsupported by the 1.1 or 2.0 csc.exe compiler used to build those targets
This commit is contained in:
sbohlen
2010-07-28 21:44:18 +00:00
parent 617adb53d6
commit 7b550ff4e4
8 changed files with 200 additions and 41 deletions

View File

@@ -11,14 +11,14 @@ namespace Spring.Context.Support
[Test]
public void Default_CaseSensitivity_isTrue()
{
XmlApplicationContextArgs args = new XmlApplicationContextArgs();
XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty,null,null,null);
Assert.True(args.CaseSensitive);
}
[Test]
public void Default_AutoRefresh_isTrue()
{
XmlApplicationContextArgs args = new XmlApplicationContextArgs();
XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);
Assert.True(args.Refresh);
}
}

View File

@@ -70,7 +70,9 @@ namespace Spring.Objects.Factory.Config
[Test]
public void Initialize_WithDictionaryConstructor_AddsCaseInsensitiveKeys()
{
IDictionary dict = new Hashtable() { { "key1", "value1" }, { "KEY2", "value2" } };
IDictionary dict = new Hashtable();
dict.Add("key1", "value1");
dict.Add("KEY2", "value2");
DictionaryVariableSource dvs = new DictionaryVariableSource(dict);
@@ -81,7 +83,9 @@ namespace Spring.Objects.Factory.Config
[Test]
public void Initialize_WithDictionaryConstructor_AddsKeys()
{
IDictionary dict = new Hashtable() { { "key1", "value1" }, { "key2", "value2" } };
IDictionary dict = new Hashtable();
dict.Add("key1", "value1");
dict.Add("key2", "value2");
DictionaryVariableSource dvs = new DictionaryVariableSource(dict);
@@ -92,7 +96,9 @@ namespace Spring.Objects.Factory.Config
[Test]
public void Initialize_WithDictionaryConstructorAndCaseSensitiveFlag_AddsCaseSensitiveKeys()
{
IDictionary dict = new Hashtable() { { "key1", "lowecasevalue" }, { "KEY1", "uppercasevalue" } };
IDictionary dict = new Hashtable();
dict.Add("key1", "lowecasevalue");
dict.Add("KEY1", "uppercasevalue");
DictionaryVariableSource dvs = new DictionaryVariableSource(dict, false);
@@ -111,6 +117,7 @@ namespace Spring.Objects.Factory.Config
Assert.AreEqual("value2", dvs.ResolveVariable("key2"));
}
#if NET_2_0
[Test]
public void Initialize_WithInlineDictionarySyntax()
{
@@ -120,14 +127,17 @@ namespace Spring.Objects.Factory.Config
Assert.AreEqual("value2", dvs.ResolveVariable("key2"));
}
#endif
[Test]
public void Requesting_KeyNotFound_ThrowsException()
{
DictionaryVariableSource dvs = new DictionaryVariableSource();
dvs.Add("key-found", "value-found");
const string THE_KEY = "key-found";
Assert.Throws<ArgumentException>(() => dvs.ResolveVariable("key-not-found"));
DictionaryVariableSource dvs = new DictionaryVariableSource();
dvs.Add(THE_KEY, "value-found");
Assert.Throws<ArgumentException>(() => dvs.ResolveVariable("not" + THE_KEY));
}
}
}

View File

@@ -11,7 +11,7 @@ namespace Spring.Context.Support
[Test]
public void Default_CaseSensitivity_isFalse()
{
WebApplicationContextArgs args = new WebApplicationContextArgs();
WebApplicationContextArgs args = new WebApplicationContextArgs(string.Empty, null, null, null);
Assert.False(args.CaseSensitive);
}
}