예제 #1
0
 public bool Equals(TestMode other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.applicationClass, applicationClass));
 }
예제 #2
0
        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()));
        }
예제 #3
0
 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()));
 }
예제 #4
0
 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;
 }
예제 #5
0
        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);
        }
예제 #6
0
 public bool Equals(TestMode other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.applicationClass, applicationClass);
 }
예제 #7
0
 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\""));
 }