public IGenerateAction InitalizeSelection(CodeGenerationOptions options, TreeView treeView) { var overrideMethods = new PartialMethods(options); overrideMethods.Initialize(treeView); return(overrideMethods); }
public void LinkedMethodsReturnValueTest2() { PartialMethods partialMethods = new PartialMethods(); BeethovenFactory beethovenFactory = new BeethovenFactory(); ITestMethods instance = beethovenFactory.Generate <ITestMethods>( new LinkedMethodsReturnValue(nameof(ITestMethods.WithParameters)) .PartialMatchMethod(partialMethods, nameof(partialMethods.WithParametersReturnValue))); Assert.AreEqual(5, instance.WithParameters("w", "sd", 3)); }
public void LinkedMethodsReturnValueTest3() { PartialMethods partialMethods = new PartialMethods(); BeethovenFactory beethovenFactory = new BeethovenFactory(); ITestMethods instance = beethovenFactory.Generate <ITestMethods>( new LinkedMethodsReturnValue(nameof(ITestMethods.GetMain)) .PartialMatchMethod <ITestMethods>(partialMethods, "testMethods")); object actual = instance.GetMain("w", "sd"); Assert.AreEqual(instance, actual); }
public void LinkedMethodsReturnValueTest1() { PartialMethods partialMethods = new PartialMethods(); BeethovenFactory beethovenFactory = new BeethovenFactory(); ITestMethods instance = beethovenFactory.Generate <ITestMethods>( LinkedMethodsReturnValue.Create <ITestMethods>(nameof(ITestMethods.WithParameters), 1) .PartialMatchMethod(partialMethods, nameof(partialMethods.WithParameters1)) .PartialMatchMethod(partialMethods, nameof(partialMethods.WithParameters2)) .PartialMatchMethod(partialMethods, nameof(partialMethods.WithParametersCount)) .PartialMatchMethod(partialMethods, nameof(partialMethods.WithParameters))); Assert.AreEqual(9, instance.WithParameters("w", "sd", 3)); Assert.AreEqual(0, instance.WithParameters(null, "sd", 3)); Assert.AreEqual(0, instance.WithParameters("w", "sd", -68)); Assert.AreEqual(0, instance.WithParameters("w", "", 7)); }
public IGenerateAction InitalizeSelection (CodeGenerationOptions options, TreeView treeView) { var overrideMethods = new PartialMethods (options); overrideMethods.Initialize (treeView); return overrideMethods; }