コード例 #1
0
        public Either <Error, Memory> LoadMemory()
        {
            var memory = new TypeDictionary();
            var error  = new Error();

            var argumentParser = new ArgumentParser();

            argumentParser.AddArgumentHandler("c", value => {
                if (!textSource.Exists(value))
                {
                    error.Add($"Suite configuration file '{value}' does not exist.");
                }
                else
                {
                    new SuiteConfiguration(memory).LoadXml(textSource.Content(value));
                }
            });
            argumentParser.AddArgumentHandler("r", value => memory.GetItem <Settings>().Runner = value);
            argumentParser.AddArgumentHandler("f", InitializeAndAddFolders);
            argumentParser.Parse(commandLineArguments);

            memory.Item <Settings>().Apply(settings => ParseRunner(memory, settings));

            if (error.IsNone && string.IsNullOrEmpty(memory.GetItem <Settings>().Runner))
            {
                error.Add("Missing runner class");
            }

            return(new Either <Error, Memory>(!error.IsNone, error, memory));
        }
コード例 #2
0
ファイル: TestUtils.cs プロジェクト: ChrisBDFA/fitsharp
 public static Memory InitAssembliesAndNamespaces()
 {
     var memory = new TypeDictionary();
     memory.GetItem<ApplicationUnderTest>().AddAssembly(Assembly.GetAssembly(typeof (TestUtils)).CodeBase);
     memory.GetItem<ApplicationUnderTest>().AddNamespace("fit.Test.NUnit");
     memory.GetItem<ApplicationUnderTest>().AddNamespace("fit.Test.Acceptance");
     return memory;
 }
コード例 #3
0
ファイル: TestUtils.cs プロジェクト: skolima/fitsharp
        public static Configuration InitAssembliesAndNamespaces()
        {
            var configuration = new TypeDictionary();

            configuration.GetItem <ApplicationUnderTest>().AddAssembly(Assembly.GetAssembly(typeof(TestUtils)).CodeBase);
            configuration.GetItem <ApplicationUnderTest>().AddNamespace("fit.Test.NUnit");
            configuration.GetItem <ApplicationUnderTest>().AddNamespace("fit.Test.Acceptance");
            return(configuration);
        }
コード例 #4
0
        public static Memory InitAssembliesAndNamespaces()
        {
            var memory = new TypeDictionary();

            memory.GetItem <ApplicationUnderTest>().AddAssembly(Assembly.GetAssembly(typeof(TestUtils)).CodeBase);
            memory.GetItem <ApplicationUnderTest>().AddNamespace("fit.Test.NUnit");
            memory.GetItem <ApplicationUnderTest>().AddNamespace("fit.Test.Acceptance");
            return(memory);
        }
コード例 #5
0
        [Test] public void CopyableChangesDontShowInCopy()
        {
            configuration.GetItem <FullTestConfig>().Data = "stuff";
            var copy = configuration.Copy();

            configuration.GetItem <FullTestConfig>().Data = "other";
            Assert.AreEqual("stuff", copy.GetItem <FullTestConfig>().Data);
            Assert.AreEqual("other", configuration.GetItem <FullTestConfig>().Data);
        }
コード例 #6
0
ファイル: StoryTestFileTest.cs プロジェクト: GibSral/fitsharp
 static void CheckResult(string content, string expected) {
     var folder = new FolderTestModel();
     var memory = new TypeDictionary();
     memory.GetItem<Settings>().OutputFolder = "output";
     var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);
     file.WriteTest(new PageResult("title", content, new TestCounts()));
     Assert.AreEqual(expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
 }
コード例 #7
0
ファイル: FitRunner.cs プロジェクト: MirekVales/FinesSE
        CellProcessorBase CreateProcessor()
        {
            var memory    = new TypeDictionary();
            var processor = new CellProcessorBase(memory, memory.GetItem <CellOperators>());

            processor.ApplicationUnderTest.AddAssemblies(assemblies);
            processor.AddNamespace("fitnesse.slim.test");
            namespaces.ToList().ForEach(processor.AddNamespace);
            return(processor);
        }
コード例 #8
0
        StoryTestFile MakeStoryTestFile(string fileName)
        {
            folder.MakeFile(fileName, "stuff");
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile(fileName,
                                         new StoryTestFolder(memory, folder, new Filters(string.Empty, new FileExclusions(), string.Empty)), folder);

            return(file);
        }
コード例 #9
0
ファイル: StoryTestFileTest.cs プロジェクト: tlunven/fitsharp
        static void CheckResult(string content, string expected)
        {
            var folder = new FolderTestModel();
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);

            file.WriteTest(new PageResult("title", content, new TestCounts()));
            Assert.AreEqual(expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
        }
コード例 #10
0
 static void CheckResult(string content, string expected)
 {
     Clock.Instance = new TestClock {Now = new DateTime(2016, 1, 2, 13, 14, 15)};
     var folder = new FolderTestModel();
     var memory = new TypeDictionary();
     memory.GetItem<Settings>().OutputFolder = "output";
     var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);
     file.WriteTest(new PageResult("title", content, new TestCounts()));
     Clock.Instance = new Clock();
     Assert.AreEqual(comment + expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
 }
コード例 #11
0
        public Either <Error, Memory> LoadMemory()
        {
            var memory = new TypeDictionary();
            var error  = new Error();

            var argumentParser = new ArgumentParser();

//            argumentParser.AddArgumentHandler("a", value => memory.GetItem<AppDomainSetup>().ConfigurationFile = value);
            argumentParser.AddArgumentHandler("c", value => {
                if (!textSource.Exists(value))
                {
                    error.Add(string.Format("Suite configuration file '{0}' does not exist.", value));
                }
                else
                {
                    new SuiteConfiguration(memory).LoadXml(textSource.Content(value));
                }
            });
            argumentParser.AddArgumentHandler("r", value => memory.GetItem <Settings>().Runner = value);
            argumentParser.AddArgumentHandler("f", InitializeAndAddFolders);
            argumentParser.AddArgumentHandler("p", PauseForDebug);
            argumentParser.Parse(commandLineArguments);

            memory.Item <Settings>().Apply(settings => ParseRunner(memory, settings));

//            if (error.IsNone) {
//                memory.Item<AppDomainSetup>().Apply(setup => ValidateApplicationBase(setup, error));
//            }

            if (error.IsNone && string.IsNullOrEmpty(memory.GetItem <Settings>().Runner))
            {
                error.Add("Missing runner class");
            }

            return(new Either <Error, Memory>(!error.IsNone, error, memory));
        }
コード例 #12
0
        static void CheckResult(string content, string expected)
        {
            Clock.Instance = new TestClock {
                Now = new DateTime(2016, 1, 2, 13, 14, 15)
            };
            var folder = new FolderTestModel();
            var memory = new TypeDictionary();

            memory.GetItem <Settings>().OutputFolder = "output";
            var file = new StoryTestFile("myfile", new StoryTestFolder(memory, folder), folder);

            file.WriteTest(new PageResult("title", content, new TestCounts()));
            Clock.Instance = new Clock();
            Assert.AreEqual(comment + expected, folder.GetPageContent(new FilePath("output\\myfile.html")));
        }
コード例 #13
0
ファイル: ConfigurationTest.cs プロジェクト: skolima/fitsharp
 public ConfigurationTest()
 {
     myConfiguration = new TypeDictionary();
     myConfiguration.GetItem <TestList>();
     SetSystemUnderTest(myConfiguration);
 }
コード例 #14
0
ファイル: TestUtils.cs プロジェクト: skolima/fitsharp
 public static Configuration InitAssembliesAndNamespaces()
 {
     var configuration = new TypeDictionary();
     configuration.GetItem<ApplicationUnderTest>().AddAssembly(Assembly.GetAssembly(typeof (TestUtils)).CodeBase);
     configuration.GetItem<ApplicationUnderTest>().AddNamespace("fit.Test.NUnit");
     configuration.GetItem<ApplicationUnderTest>().AddNamespace("fit.Test.Acceptance");
     return configuration;
 }