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)); }
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; }
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); }
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); }
[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); }
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"))); }
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); }
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); }
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"))); }
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"))); }
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)); }
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"))); }
public ConfigurationTest() { myConfiguration = new TypeDictionary(); myConfiguration.GetItem <TestList>(); SetSystemUnderTest(myConfiguration); }
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; }