public void InvalidTryGetValueTest() { var locator = new CodeConfigLocator(); ExceptionAssert.Throws <ArgumentNullException>(() => { string str; locator.TryGetValue(null, out str); }); }
public void TryGetValueTest() { var locator = new CodeConfigLocator(); locator.Set("hello", "world"); string str; if (!locator.TryGetValue("hello", out str)) { Assert.Fail("can not get [hello]"); } Assert.AreEqual("world", str); if (locator.TryGetValue("123", out str)) { Assert.Fail(); } Assert.AreEqual(null, str); }