コード例 #1
0
        public void TestValidBuildManifestData()
        {
            List <BuildManifestFile> outputs = new List <BuildManifestFile>();
            BuildManifestData        data0   = new BuildManifestData("Version", 1598291222, "cbId", "Repo", "branch", "commitId", outputs);

            XAssert.IsTrue(BuildManifestData.TryParse(data0.ToString(), out var parsedData0));
            XAssert.AreEqual(data0, parsedData0);

            outputs.Add(new BuildManifestFile("relativePath1", "vsohash", "sha256Hash"));
            BuildManifestData data1 = new BuildManifestData("Version", 1598291222, "cbId", "Repo", "branch", "commitId", outputs);

            XAssert.IsTrue(BuildManifestData.TryParse(data1.ToString(), out var parsedData1));
            XAssert.AreEqual(data1, parsedData1);

            outputs.Add(new BuildManifestFile("relativePath2", "vsohash", "sha256Hash"));
            BuildManifestData data2 = new BuildManifestData("Version", 1598291222, "cbId", "Repo", "branch", "commitId", outputs);

            XAssert.IsTrue(BuildManifestData.TryParse(data2.ToString(), out var parsedData2));
            XAssert.AreEqual(data2, parsedData2);
        }
コード例 #2
0
 public void TestOutputCountInBuildManifestData(string str, bool isValid)
 {
     XAssert.AreEqual(BuildManifestData.TryParse(str, out _), isValid);
 }
コード例 #3
0
 [InlineData("string|1|not-int")]  // 3rd field not an int
 public void TestInvalidBuildManifestData(string str)
 {
     XAssert.IsFalse(BuildManifestData.TryParse(str, out _));
 }