コード例 #1
0
        public void ShouldCreateStrictInstanceOfInterfaceWithDefaultCtor()
        {
            Interaction i       = new Interaction();
            IMockable   fooMock = i.CreateStrictMock <IMockable>();

            Specify.That(fooMock).ShouldNotBeNull();
        }
コード例 #2
0
        public void ShouldCreateStrictInstanceOfAbstractType()
        {
            Interaction  i           = new Interaction();
            MockableBase fooBaseMock = i.CreateStrictMock <MockableBase>();

            Specify.That(fooBaseMock).ShouldNotBeNull();
        }
コード例 #3
0
        public void ShouldReturnStrictMockOfCorrectType()
        {
            Interaction i    = new Interaction();
            object      mock = i.CreateStrictMock <StrictMockSpec>();

            Specify.That(mock.GetType().FullName).ShouldEqual("NBehave.Spec.Framework.Specification.Mocks.__Proxy__StrictMockSpec");
        }
コード例 #4
0
        public void ShouldReturnStrictMockWhenSupplyingCtorArgs()
        {
            Interaction    i    = new Interaction();
            StrictMockSpec mock = i.CreateStrictMock <StrictMockSpec>(5, "Test");

            Specify.That(mock.i).ShouldEqual(5);
            Specify.That(mock.s).ShouldEqual("Test");
            Specify.That(mock.GetType().FullName).ShouldEqual("NBehave.Spec.Framework.Specification.Mocks.__Proxy__StrictMockSpec");
        }
コード例 #5
0
 public void CompareOneWithTwo()
 {
     Specify.That(1).ShouldEqual(2);
 }
コード例 #6
0
 public void CompareMinValues()
 {
     Specify.That(int.MinValue).ShouldEqual(int.MinValue);
 }
コード例 #7
0
 public void CompareOnes()
 {
     Specify.That(1).ShouldEqual(1);
 }
コード例 #8
0
        public void ShouldFailWhenComparingOneWithTwo()
        {
            TestStepRun run = Runner.GetPrimaryTestStepRun(CodeReference.CreateFromMember(typeof(Int32ComparisonSpecSample).GetMethod("CompareOneWithTwo")));

            Specify.That(run.Result.Outcome).ShouldEqual(TestOutcome.Failed);
        }
コード例 #9
0
        public void ShouldPassWhenComparingMinValues()
        {
            TestStepRun run = Runner.GetPrimaryTestStepRun(CodeReference.CreateFromMember(typeof(Int32ComparisonSpecSample).GetMethod("CompareMinValues")));

            Specify.That(run.Result.Outcome).ShouldEqual(TestOutcome.Passed);
        }