public void DeleteConcreteTest(string code) { var concreteTest = new ConcreteTest() { Code = code }; ConcreteTestMethods.Instance.DeleteConcreteTest(concreteTest); }
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" }
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); }
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); }
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)); }
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)); }
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); }
public Main() { var ct = new ConcreteTest(); ct.MyMethod(new Test()); }