コード例 #1
0
		public async Task GetValueAsyncTest()
		{
			DiskExposer exposer = new DiskExposer();
			exposer.GetValues["TEST"] = "This is my Test";
			exposer.GetValues["TEST2"] = "Another Test";
			exposer.GetValues["TITLE"] = "Title value";

			var config = exposer.GetConfiguration as ConfigurationExposer;
			config.GetValues["CONFIGTITLE"] = "This is the Config Title";
			config.GetValues["DESCRIPTION"] = "This is the Description";

			Assert.AreEqual<String>("This is my Test", await exposer.GetValueAsync("test"), "Test value does not match");
			Assert.AreEqual<String>("Another Test", await exposer.GetValueAsync("test2"), "Test2 value does not match");
			Assert.AreEqual<String>("Title value", await exposer.GetValueAsync("title"), "Title value does not match");
			Assert.AreEqual<String>("This is the Config Title", await exposer.GetValueAsync("configtitle"), "ConfigTitle value does not match");
			Assert.AreEqual<String>("This is the Description", await exposer.GetValueAsync("description"), "Description value does not match");
			Assert.IsNull(await exposer.GetValueAsync("cheese"), "cheese value was suppose to be null and was not");
		}