Пример #1
0
        public void Label_ConstructorWithTwoArguments_ReturnsConstructorArgumentLabel(string label)
        {
            // Arrange N/A

            ResultState resultState = new ResultState(TestStatus.Failed, label);

            Assert.AreEqual(label, resultState.Label);
        }
Пример #2
0
        public void Label_ConstructorWithOneArguments_ReturnsStringEmpty()
        {
            // Arrange N/A

            ResultState resultState = new ResultState(TestStatus.Failed);

            Assert.AreEqual(string.Empty, resultState.Label);
        }
Пример #3
0
        public void Status_ConstructorWithTwoArguments_ReturnsConstructorArgumentStatus(TestStatus status)
        {
            // Arrange N/A

            ResultState resultState = new ResultState(status, string.Empty);

            Assert.AreEqual(status, resultState.Status);
        }
Пример #4
0
		public void RunTests(MethodInfo method, ResultState resultState, int assertionCount)
		{
			var test = _builder.BuildFrom(method);
			var result = TestBuilder.RunTest(test, _testObject);

			Assert.That(result.ResultState, Is.EqualTo(resultState), "Wrong result state");
            Assert.That(result.AssertCount, Is.EqualTo(assertionCount), "Wrong assertion count");
		}
Пример #5
0
 void VerifyResultState(ResultState expectedState, string message )
 {
     Assert.That( result.ResultState , Is.EqualTo( expectedState ) );
     //if ( expectedState == ResultState.Error )
     //    Assert.That(result.Message, Is.EqualTo("System.Exception : " + message));
     //else
         Assert.That(result.Message, Is.EqualTo(message));
 }
Пример #6
0
        public void Label_ConstructorWithTwoArgumentsLabelArgumentIsNull_ReturnsEmptyString()
        {
            // Arrange N/A

            ResultState resultState = new ResultState(TestStatus.Failed, null);

            Assert.AreEqual(string.Empty, resultState.Label);
        }
Пример #7
0
 /// <summary>
 /// Verify that a Type is runnable, then run it and
 /// verify the result.
 /// </summary>
 public static void IsRunnable(Type type, ResultState resultState)
 {
     TestSuite suite = TestBuilder.MakeFixture(type);
     Assert.NotNull(suite, "Unable to construct fixture");
     Assert.AreEqual(RunState.Runnable, suite.RunState);
     ITestResult result = TestBuilder.RunTest(suite);
     Assert.AreEqual(resultState, result.ResultState);
 }
Пример #8
0
 public static void IsRunnable(Type type, string name, ResultState resultState)
 {
     Test test = TestBuilder.MakeTestCase(type, name);
     Assert.That(test.RunState, Is.EqualTo(RunState.Runnable));
     object testObject = Activator.CreateInstance(type);
     ITestResult result = TestBuilder.RunTest(test, testObject);
     if (result.HasChildren) // In case it's a parameterized method
         result = (ITestResult)result.Children[0];
     Assert.That(result.ResultState, Is.EqualTo(resultState));
 }
Пример #9
0
		object ToXmlString (ResultState resultState)
		{
			if (resultState == ResultState.Success)
				return "Success";
			else if (resultState == ResultState.Inconclusive)
				return "Inconclusive";
			else if (resultState == ResultState.Ignored)
				return "Ignored";
			else
				return "Failure";
		}
Пример #10
0
        public void ToString_Constructor_ReturnsExpectedString(TestStatus status, string label, string expected)
        {
            ResultState resultState = new ResultState(status, label);

            Assert.AreEqual(expected, resultState.ToString());
        }
Пример #11
0
        public void Site_ConstructorWithTwoArguments_ReturnsTest(string label)
        {
            ResultState resultState = new ResultState(TestStatus.Failed, label);

            Assert.AreEqual(FailureSite.Test, resultState.Site);
        }
Пример #12
0
        public void Site_ConstructorWithOneArguments_ReturnsTest()
        {
            ResultState resultState = new ResultState(TestStatus.Failed);

            Assert.AreEqual(FailureSite.Test, resultState.Site);
        }
Пример #13
0
        public void Label_ConstructorWithTwoArgumentsLabelArgumentIsNull_ReturnsEmptyString()
        {
            ResultState resultState = new ResultState(TestStatus.Failed, null);

            Assert.AreEqual(string.Empty, resultState.Label);
        }
Пример #14
0
        public void Label_ConstructorWithTwoArguments_ReturnsConstructorArgumentLabel(string label)
        {
            ResultState resultState = new ResultState(TestStatus.Failed, label);

            Assert.AreEqual(label, resultState.Label);
        }
Пример #15
0
        public void Status_ConstructorWithTwoArguments_ReturnsConstructorArgumentStatus(TestStatus status)
        {
            ResultState resultState = new ResultState(status, string.Empty);

            Assert.AreEqual(status, resultState.Status);
        }
Пример #16
0
        public void Label_ConstructorWithOneArguments_ReturnsStringEmpty()
        {
            ResultState resultState = new ResultState(TestStatus.Failed);

            Assert.AreEqual(string.Empty, resultState.Label);
        }
Пример #17
0
        public void ToString_Constructor_ReturnsExepectedString(TestStatus status, string label, string expected)
        {
            // Arrange N/A

            ResultState resultState = new ResultState(status, label);

            Assert.AreEqual(expected, resultState.ToString());
        }
Пример #18
0
        public void Site_ConstructorWithThreeArguments_ReturnsSite(string label, FailureSite site)
        {
            ResultState resultState = new ResultState(TestStatus.Failed, label, site);

            Assert.AreEqual(site, resultState.Site);
        }