public void ImportAbsoluteBasedManifest()
        {
            string sourceFile = Path.Combine(Path.GetTempPath(), "ImportManifest.xml");
            string expectedManifest = "<manifest>" +
                    "From a file" +
                "</manifest>";
            if (File.Exists(sourceFile)) File.Delete(sourceFile);
            File.WriteAllText(sourceFile, expectedManifest);

            ManifestImporter generator = new ManifestImporter();
            generator.FileName = sourceFile;
            IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "Somewhere", null);
            IntegrationSummary summary = new IntegrationSummary(IntegrationStatus.Success, "A Label", "Another Label", new DateTime(2009, 1, 1));
            IntegrationResult result = new IntegrationResult("Test project", "Working directory", "Artifact directory", request, summary);
            List<string> files = new List<string>();
            XmlDocument manifest = generator.Generate(result, files.ToArray());

            Assert.IsNotNull(manifest);
            string actualManifest = manifest.OuterXml;
            Assert.AreEqual(expectedManifest, actualManifest);
        }
 public void ImportWithoutAFilename()
 {
     ManifestImporter generator = new ManifestImporter();
     Assert.That(delegate { generator.Generate(null, null); },
                 Throws.TypeOf<ArgumentOutOfRangeException>().With.Property("ParamName").EqualTo("FileName"));
 }
 public void CheckAllProperties()
 {
     ManifestImporter generator = new ManifestImporter();
     generator.FileName = "File name";
     Assert.AreEqual("File name", generator.FileName);
 }