Ejemplo n.º 1
0
        public void Test4()
        {
            int a = 10;
            int b = ToTest.testMethod();

            Assert.Equal(a, b);
        }
Ejemplo n.º 2
0
            public override void FindPathRecursive()
            {
                base.FindPathRecursive();

                if (nextWaypoint is Corner)
                {
                    targetCornerIndex = corners.IndexOf((Corner)nextWaypoint);
                }

                if (stations.Contains(target))
                {
                    target.nextWaypoint = this;
                    target.FindPathRecursive();
                    return;
                }

                for (int i = 0; i < corners.Count; i++)
                {
                    if (corners[i] != nextWaypoint && !corners[i].visited)
                    {
                        corners[i].nextWaypoint = this;
                        ToTest.Enqueue(corners[i]);
                    }
                }

                if (ToTest.Count > 0)
                {
                    ToTest.Dequeue().FindPathRecursive();
                }
            }
Ejemplo n.º 3
0
 public void SetUp()
 {
     _instance = new ToTest();
     _instance.InputDataStore(1, "1");
     _instance.InputDataStore(2, "2");
     _instance.InputDataStore(3, "3");
     _instance.InputDataStore(4, "4");
 }
Ejemplo n.º 4
0
    public void TestWithStub()
    {
        var dependecyStub = new DependencyTest();
        var toTest        = new ToTest();

        toTest.Foo(dependecyStub);
        Assert.AreEqual(23, toTest.Xa);
    }
    public void Test_MethodC()
    {
        var    mocks        = new MockRepository();
        ToTest testedObject = mocks.CreateMock <ToTest>();

        testedObject.Expect(t => t.MethodA()).Return("AString");
        testedObject.Expect(t => t.MethodB()).Return(1324);
        Assert.AreEqual("AString 1324", testedObject.MethodC());
    }
Ejemplo n.º 6
0
        public static void Main()
        {
            ToTest testing = ToTest.Interop;

            switch (testing)
            {
            case ToTest.Interop: run(new InteropTest()); break;
            }

            Console.ReadLine();
        }
Ejemplo n.º 7
0
    public void TestWithMoq()
    {
        var dependecyMock = new Mock <IDependency>();

        dependecyMock.Setup(d => d.A).Returns(23);
        var toTest = new ToTest();

        toTest.Foo(dependecyMock.Object);
        Assert.AreEqual(23, toTest.Xa);
        dependecyMock.Verify(d => d.A, Times.Once);
    }
Ejemplo n.º 8
0
            public override void FindPathRecursive()
            {
                base.FindPathRecursive();

                foreach (Corridor corridor in corridors)
                {
                    if (corridor != nextWaypoint && !corridor.visited)
                    {
                        corridor.nextWaypoint = this;
                        ToTest.Enqueue(corridor);
                    }
                }

                if (ToTest.Count > 0)
                {
                    ToTest.Dequeue().FindPathRecursive();
                }
            }
Ejemplo n.º 9
0
 public LogicTest()
 {
     toTest = new ToTest();
 }