Пример #1
0
        public void DeleteConcreteTest(string code)
        {
            var concreteTest = new ConcreteTest()
            {
                Code = code
            };

            ConcreteTestMethods.Instance.DeleteConcreteTest(concreteTest);
        }
Пример #2
0
    static void Main(string[] args)
    {
        String isPassed = "original";
        ATest  test     = new ConcreteTest(status => isPassed = status);

        test.Start();
        // Need to add a way to wait for task to be done here
        Console.WriteLine(isPassed);         // Prints out "original"
    }
Пример #3
0
        public void TestResolveFromInterfaceBoundToFactoryWithKey()
        {
            var ioc = new IocContainer();

            var          test    = new ConcreteTest();
            Func <ITest> factory = () => test;

            ioc.Bind <ITest>("key", factory);

            ITest obj = ioc.Resolve <ITest>("key");

            Assert.AreSame(test, obj);
        }
Пример #4
0
        public void TestImplicitRegistrationCreatedForConstructibleType()
        {
            var ioc = new IocContainer();

            var          test    = new ConcreteTest();
            Func <ITest> factory = () => test;

            ioc.Bind <ITest>(factory);

            ObjectTakingITest obj = ioc.Resolve <ObjectTakingITest>();

            Assert.AreSame(test, obj.Test);
        }
Пример #5
0
        public string AddConcreteTest(DtoConcreteTest dtoConcreteTest)
        {
            var concreteTest = new ConcreteTest()
            {
                Order = new Order
                {
                    Id = OrderMethods.Instance.GetOrderByNumber(dtoConcreteTest.Order.Number).Id
                },
                Test = new Test()
                {
                    Id = TestMethods.Instance.GetTestByCode(dtoConcreteTest.Test.Code).Id
                }
            };

            return(ConcreteTestMethods.Instance.InsertConcreteTest(concreteTest));
        }
Пример #6
0
        public bool EditConcreteTest(DtoConcreteTest dtoConcreteTest)
        {
            var concreteTest = new ConcreteTest()
            {
                Id   = ConcreteTestMethods.Instance.GetConcreteTestByCode(dtoConcreteTest.Code).Id,
                Code = dtoConcreteTest.Code,
                Test = new Test()
                {
                    Id = TestMethods.Instance.GetTestByCode(dtoConcreteTest.Test.Code).Id,
                },
                Order = new Order()
                {
                    Id = ConcreteTestMethods.Instance.GetConcreteTestByCode(dtoConcreteTest.Code).Order.Id,
                }
            };

            return(ConcreteTestMethods.Instance.UpdateConcreteTest(concreteTest));
        }
Пример #7
0
        public void OverridedMethodTest()
        {
            var test   = new ConcreteTest();
            var result = test.GetLargerNumberVirtual(1, 2);

            Assert.AreEqual(2, result);

            var methodInfo = typeof(ConcreteTest).GetMethod("GetLargerNumberVirtual");

            MockEngine.Mock(methodInfo, act);

            var testAfter   = new Test();
            var resultAfter = testAfter.GetLargerNumberVirtual(1, 2);

            var concreteTest   = new ConcreteTest();
            var concreteResult = concreteTest.GetLargerNumberVirtual(1, 2);

            Assert.AreEqual(2, resultAfter);
            Assert.AreEqual(1, concreteResult);
        }
Пример #8
0
    public Main()
    {
        var ct = new ConcreteTest();

        ct.MyMethod(new Test());
    }