Пример #1
0
        public void Parse_NoBrake()
        {
            IList <string>  assemblyList    = new[] { "abc.dll", "abb.dll" };
            Assembly        assemblyAbc     = Assembly.GetAssembly(typeof(int));
            Assembly        assemblyAbb     = Assembly.GetAssembly(typeof(ContainerBuilder));
            TestAssembly    testAssemblyAbc = new TestAssembly();
            TestAssembly    testAssemblyAbb = new TestAssembly();
            IList <RunData> itemsAbc        = Stub <IList <RunData> >();
            IList <RunData> itemsAbb        = Stub <IList <RunData> >();

            using (Ordered())
            {
                breaker.Expect((m) => m.IsBreakReceived()).Return(false);
                args.Expect(m => m.AssemblyList).Return(assemblyList);

                windowsFileHelper.Expect((m) => m.GetAssembly(assemblyList[0])).Return(assemblyAbc);
                parser.Expect((m) => m.Parse(assemblyAbc, FilterMode.None, null)).Return(testAssemblyAbc);
                runDataBuilder.Expect(m => m.Create(testAssemblyAbc)).Return(itemsAbc);
                runDataListBuilder.Expect(m => m.Add(itemsAbc));

                windowsFileHelper.Expect((m) => m.GetAssembly(assemblyList[1])).Return(assemblyAbb);
                parser.Expect((m) => m.Parse(assemblyAbb, FilterMode.None, null)).Return(testAssemblyAbb);
                runDataBuilder.Expect(m => m.Create(testAssemblyAbb)).Return(itemsAbb);
                runDataListBuilder.Expect(m => m.Add(itemsAbb));
            }

            VerifyTarget(() => target.Parse(FilterMode.None, null, null));
        }
        public void CreateSettingsFile()
        {
            string path    = string.Concat(input.Root, "\\", input.RunId, ".settings");
            string content = string.Concat(
                "<?xml version=\"1.0\" encoding=\"UTF-8\"?><RunSettings><RunConfiguration><ResultsDirectory>",
                input.RunId,
                "</ResultsDirectory></RunConfiguration></RunSettings>");

            fileHelper.Expect((m) => m.WriteFile(path, content));
            VerifyTarget(() => target.CreateSettingsFile(input));
        }
Пример #3
0
        public void OpenResultFile()
        {
            ITestRunnerArgs args     = Stub <ITestRunnerArgs>();
            Stream          expected = new MemoryStream();

            windowsFileHelper.Expect((m) => m.OpenResultFile(args)).Return(expected);
            Stream actual = VerifyTarget(() => target.OpenResultFile(args));

            Assert.AreEqual(expected, actual);
        }