예제 #1
0
        public static TestArtifact GetTestArtifact(this Configuration @this, MethodBase testMethod, DateTime dateTime)
        {
            var testArtifactProp       = new TestArtifactProperty(AppDomain.CurrentDomain.BaseDirectory, testMethod, dateTime);
            var testDllDirInfo         = new DirectoryInfo(testArtifactProp.TestDllDirectory);
            var testArtifactDirNameGen = testArtifactProp.GetDirectoryNameGenerator();

            if (testDllDirInfo.Exists)
            {
                foreach (var dirInfo in testDllDirInfo.EnumerateDirectories())
                {
                    if (!testArtifactDirNameGen.TryUpdate(dirInfo.Name))
                    {
                        continue;
                    }

                    var tmpTestArtifact = new TestArtifact(dirInfo.FullName, testArtifactProp);
                    using (var sr = new StreamReader(tmpTestArtifact.FullName))
                        using (var xr = new XmlTextReader(sr))
                        {
                            var ndcs         = new NetDataContractSerializer();
                            var testArtifact = (TestArtifact)ndcs.ReadObject(xr);
                            if (testArtifact.Test == testMethod)
                            {
                                tmpTestArtifact.CopyNonDataMemberTo(testArtifact);
                                return(testArtifact);
                            }
                        }
                }
            }
            return(new TestArtifact(testArtifactDirNameGen.Directory, testArtifactProp));
        }
예제 #2
0
        public TestArtifact(string testArtifactDirectory, TestArtifactProperty testArtifactProp)
        {
            Directory = testArtifactDirectory;
            Property  = testArtifactProp;

            if (!Directory.EndsWith(@"\"))
            {
                Directory += @"\";
            }
        }
예제 #3
0
        static string MakeDirectory(int maxBranchNumber, TestArtifactProperty testArtifactProp)
        {
            var testNameSuffix = "_" + (maxBranchNumber + 1);

            return(Path.Combine(testArtifactProp.TestDllDirectory, testArtifactProp.TestName + testNameSuffix));
        }
예제 #4
0
 public TestArtifactDirectoryNameGenerator(TestArtifactProperty testArtifactProp)
 {
     m_testArtifactProp = testArtifactProp;
 }