Esempio n. 1
0
        public void RethrowIfAssertExceptionThrowsExceptionOnAssertFailure()
        {
            Action a = () => this.sut.RethrowIfAssertException(new TestFrameworkV2.AssertFailedException());

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 2
0
        public void InstanceNotOfTypeShouldFailWhenTypeIsNull()
        {
            Action action = () => TestFrameworkV2.Assert.IsNotInstanceOfType(5, null);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 3
0
 public void UnitTestElementConstructorShouldThrowIfTestMethodIsNull()
 {
     ActionUtility.ActionShouldThrowExceptionOfType(
         () => new UnitTestElement(null),
         typeof(ArgumentNullException));
 }
Esempio n. 4
0
        public void RunSingleTestShouldThrowIfTestMethodIsNull()
        {
            Action a = () => this.unitTestRunner.RunSingleTest(null, null);

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(ArgumentNullException));
        }
Esempio n. 5
0
        public void InstanceOfTypeShouldFailWhenValueIsNull()
        {
            Action action = () => TestFrameworkV2.Assert.IsInstanceOfType(null, typeof(AssertTests));

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 6
0
        public void AreEqualShouldFailWhenNotEqualFloatWithDelta()
        {
            Action action = () => TestFrameworkV2.Assert.AreEqual(100E-2, 200E-2, 50E-2);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
 public void LoadShouldThrowIfReaderIsNull()
 {
     ActionUtility.ActionShouldThrowExceptionOfType(() => this.settingsProvider.Load(null), typeof(ArgumentNullException));
 }
Esempio n. 8
0
        public void AreEqualShouldFailWhenNotEqualDouble()
        {
            Action action = () => TestFrameworkV2.Assert.AreEqual(0.1, 0.2);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 9
0
        public void AreEqualShouldFailWhenNotEqualDecimalWithDelta()
        {
            Action action = () => TestFrameworkV2.Assert.AreEqual(0.1M, 0.2M, 0.05M);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 10
0
        public void AreNotEqualShouldFailWhenNotEqualLongWithDelta()
        {
            Action action = () => TestFrameworkV2.Assert.AreNotEqual(1L, 2L, 1L);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 11
0
        public void AreEqualShouldFailWhenNotEqualStringAndCaseIgnored()
        {
            Action action = () => TestFrameworkV2.Assert.AreEqual("A", "a", false);

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 12
0
        public void AreNotEqualShouldFailWhenNotEqualString()
        {
            Action action = () => TestFrameworkV2.Assert.AreNotEqual("A", "A");

            ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TestFrameworkV2.AssertFailedException));
        }
Esempio n. 13
0
        public void DiscoverTestsShouldThrowIfLoggerIsNull()
        {
            Action a = () => this.discoverer.DiscoverTests(new List <string>(), this.mockDiscoveryContext.Object, null, this.mockTestCaseDiscoverySink.Object);

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(ArgumentNullException));
        }
Esempio n. 14
0
        public void DiscoverTestsShouldThrowIfSourcesIsNull()
        {
            Action a = () => this.discoverer.DiscoverTests(null, this.mockDiscoveryContext.Object, this.mockMessageLogger.Object, this.mockTestCaseDiscoverySink.Object);

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(ArgumentNullException));
        }
        public void ExpectedExceptionAttributeConstructerShouldThrowArgumentException()
        {
            Action a = () => new TestFrameworkV2.ExpectedExceptionAttribute(typeof(ExpectedExceptionAttributeTests), "Dummy");

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(ArgumentException));
        }
        public void ExpectedExceptionAttributeConstructerShouldThrowArgumentNullExceptionWhenExceptionTypeIsNull()
        {
            Action a = () => new TestFrameworkV2.ExpectedExceptionAttribute(null, "Dummy");

            ActionUtility.ActionShouldThrowExceptionOfType(a, typeof(ArgumentNullException));
        }