Exemple #1
0
 /// <summary>
 /// Verifies HasMetadata for all Built In Metadata for a specific BuildItem
 /// </summary>
 /// <param name="item">The BuildItem you want to verify against</param>
 private void VerifyHasMetaDataOnBuiltInMetadata(BuildItem item)
 {
     foreach (string s in builtInMetadataNames)
     {
         Assertion.AssertEquals(true, item.HasMetadata(s));
     }
 }
Exemple #2
0
        public void ConstructHasMetadata()
        {
            BuildItem item = new BuildItem("m", "v");

            Assertion.AssertEquals(false, item.HasMetadata("m"));
            Assertion.AssertEquals(string.Empty, item.GetEvaluatedMetadata("m"));
            Assertion.AssertEquals(string.Empty, item.GetMetadata("m"));
            Assertion.AssertEquals(builtInMetadataNames.Length, item.MetadataCount);
            Assertion.AssertEquals(0, item.CustomMetadataCount);
        }
Exemple #3
0
        public void SetMetadataSimple()
        {
            BuildItem item = new BuildItem("n", "i");
            item.SetMetadata("m", "v");

            Assertion.AssertEquals(true, item.HasMetadata("m"));
            Assertion.AssertEquals("v", item.GetMetadata("m"));
        }
Exemple #4
0
		public void TestRemoveMetadata1 ()
		{
			string itemName = "a";
			string itemInclude = "a";
			string metadataName = "name";
			string metadataValue = "a;b;c";

			item = new BuildItem (itemName, itemInclude);

			item.SetMetadata (metadataName, metadataValue);

			Assert.AreEqual (true, item.HasMetadata (metadataName), "A1");

			item.RemoveMetadata (metadataName);

			Assert.AreEqual (false, item.HasMetadata (metadataName), "A2");
		}
Exemple #5
0
		public void TestHasMetadata3 ()
		{
			item = new BuildItem ("name", "spec");
			item.HasMetadata (null);
		}
Exemple #6
0
		public void TestHasMetadata1 ()
		{
			string itemName = "a";
			string itemInclude = "a";
			string metadataName = "name";

			item = new BuildItem (itemName, itemInclude);

			Assert.AreEqual (false, item.HasMetadata (metadataName), "A1");

			item.SetMetadata (metadataName, "value");

			Assert.AreEqual (true, item.HasMetadata (metadataName), "A2");
			Assert.IsTrue (item.HasMetadata ("FullPath"), "A3");
			Assert.IsTrue (item.HasMetadata ("RootDir"), "A4");
			Assert.IsTrue (item.HasMetadata ("Filename"), "A5");
			Assert.IsTrue (item.HasMetadata ("Extension"), "A6");
			Assert.IsTrue (item.HasMetadata ("RelativeDir"), "A7");
			Assert.IsTrue (item.HasMetadata ("Directory"), "A8");
			Assert.IsTrue (item.HasMetadata ("RecursiveDir"), "A9");
			Assert.IsTrue (item.HasMetadata ("Identity"), "A10");
			Assert.IsTrue (item.HasMetadata ("ModifiedTime"), "A11");
			Assert.IsTrue (item.HasMetadata ("CreatedTime"), "A12");
			Assert.IsTrue (item.HasMetadata ("AccessedTime"), "A13");
		}
Exemple #7
0
		static void CheckBuildItem (BuildItem item, string name, string [,] metadata, string finalItemSpec, string prefix)
		{
			Assert.AreEqual (name, item.Name, prefix + "#1");
			for (int i = 0; i < metadata.GetLength (0); i++) {
				string key = metadata [i, 0];
				string val = metadata [i, 1];
				Assert.IsTrue (item.HasMetadata (key), String.Format ("{0}#2: Expected metadata '{1}' not found", prefix, key));
				Assert.AreEqual (val, item.GetMetadata (key), String.Format ("{0}#3: Value for metadata {1}", prefix, key));
				Assert.AreEqual (val, item.GetEvaluatedMetadata (key), String.Format ("{0}#4: Value for evaluated metadata {1}", prefix, key));
			}
			Assert.AreEqual (finalItemSpec, item.FinalItemSpec, prefix + "#5");
		}