public bool Equals(TestMode other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.applicationClass, applicationClass)); }
public void CreatedWithoutCommandline() { Assert.AreEqual(ApplicationClass.WinForm, TestMode.Create(string.Empty).ClassFor(new SampleWinFormsTest())); Assert.AreEqual(ApplicationClass.WPF, TestMode.Create(string.Empty).ClassFor(new SampleWPFTest())); Assert.AreEqual(TestMode.DefaultAppClass, TestMode.Create(string.Empty).ClassFor(new SampleTest())); TestMode.DefaultAppClass = ApplicationClass.WinForm; Assert.AreEqual(TestMode.DefaultAppClass, TestMode.Create(string.Empty).ClassFor(new SampleMultiCategoryTest())); TestMode.DefaultAppClass = ApplicationClass.WPF; Assert.AreEqual(TestMode.DefaultAppClass, TestMode.Create(string.Empty).ClassFor(new SampleMultiCategoryTest())); TestMode.DefaultAppClass = ApplicationClass.SWT; Assert.AreNotEqual(TestMode.DefaultAppClass, TestMode.Create(string.Empty).ClassFor(new SampleMultiCategoryTest())); }
public void ClassFor() { Assert.AreEqual(ApplicationClass.WinForm, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WPF").ClassFor(new SampleTest())); Assert.AreEqual(ApplicationClass.WPF, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WinForm").ClassFor(new SampleTest())); Assert.AreEqual(ApplicationClass.WinForm, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WinForm").ClassFor(new SampleWinFormsTest())); Assert.AreEqual(ApplicationClass.WinForm, TestMode.Create("nunitconsole etc etc /exclude:\"FOOOOOOOO,Faaaa,WinForm\"").ClassFor(new SampleWinFormsTest())); Assert.AreEqual(ApplicationClass.WPF, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WinForm").ClassFor(new SampleWPFTest())); Assert.AreEqual(ApplicationClass.WinForm, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WPF").ClassFor(new SampleWinFormsTest())); Assert.AreEqual(ApplicationClass.WPF, TestMode.Create("nunitconsole etc etc /exclude:FOOOOOOOO,Faaaa,WPF").ClassFor(new SampleWPFTest())); Assert.AreEqual(ApplicationClass.WPF, TestMode.Create("nunitconsole etc etc /exclude:\"FOOOOOOOO,Faaaa,WPF\"").ClassFor(new SampleWPFTest())); }
public static TestMode Create(string commandLineArguments) { var testMode = new TestMode(); bool containsExternalMode = commandLineArguments.Contains("/exclude"); if (containsExternalMode) { var modes = new List<string> {Constants.WPFFrameworkId, Constants.WinFormFrameworkId, Constants.SWT}; string[] strings = commandLineArguments.Split(new[] {"/exclude:"}, StringSplitOptions.None); strings = strings[1].Split(',', '\"', ' '); foreach (string exclude in strings) modes.Remove(exclude); testMode.applicationClass = (ApplicationClass) Enum.Parse(typeof (ApplicationClass), modes[0]); } return testMode; }
public static TestMode Create(string commandLineArguments) { var testMode = new TestMode(); bool containsExternalMode = commandLineArguments.Contains("/exclude"); if (containsExternalMode) { var modes = new List <string> { Constants.WPFFrameworkId, Constants.WinFormFrameworkId, Constants.SWT }; string[] strings = commandLineArguments.Split(new[] { "/exclude:" }, StringSplitOptions.None); strings = strings[1].Split(',', '\"', ' '); foreach (string exclude in strings) { modes.Remove(exclude); } testMode.applicationClass = (ApplicationClass)Enum.Parse(typeof(ApplicationClass), modes[0]); } return(testMode); }
public void Create() { Assert.AreEqual(new TestMode(ApplicationClass.SWT), TestMode.Create("nunitconsole etc etc /exclude:WPF,Normal,WinForm")); Assert.AreEqual(new TestMode(ApplicationClass.SWT), TestMode.Create("nunitconsole etc etc /exclude:\"WPF,Normal,WinForm\"")); Assert.AreEqual(new TestMode(ApplicationClass.SWT), TestMode.Create("nunitconsole etc etc /exclude:\"WPF, Normal, WinForm\"")); }
public bool Equals(TestMode other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.applicationClass, applicationClass); }