private AnalysisHelper SetCoreNoUI() { StyleCopVSPackage packageAccessor = new StyleCopVSPackage(); packageAccessor.Core.DisplayUI = false; return(packageAccessor.Helper); }
public void MyTestInitialize() { try { // Creating a package will set the factory service provider. this.package = new StyleCopVSPackage(); this.mockServiceProvider = new Mock <IServiceProvider>(); // Creates a dummy violation (In visual studio the violation is displayed in Error List panel) this.violation = CreateDummyViolationInfo(); Assert.IsNotNull(this.package, "this.package is null"); PrivateObject actual = new PrivateObject(this.package, new PrivateType(typeof(StyleCopVSPackage))); StyleCopCore core = (StyleCopCore)actual.GetFieldOrProperty("Core"); Assert.IsNotNull(core, "core is null"); core.DisplayUI = false; this.taskUnderTest = new ViolationTask(this.package, this.violation, null); this.taskUnderTestShell = this.taskUnderTest; } catch (Exception ex) { // Use try catch to test a workaround on CI build (AppVeyor) Console.WriteLine(ex.Message); } }
public void MyTestInitialize() { // Creating a package wil lset the facoctory service provider. this.package = new StyleCopVSPackage(); this.mockServiceProvider = new Mock <IServiceProvider>(); this.violation = CreateDummyViolationInfo(); StyleCopVSPackage_Accessor.AttachShadow(this.package).Core.DisplayUI = false; this.taskUnderTest = new ViolationTask_Accessor(this.package, violation); this.taskUnderTestShell = ErrorTask_Accessor.AttachShadow(this.taskUnderTest.Target); }
public void MyTestInitialize() { // Creating a package will set the factory service provider. this.package = new StyleCopVSPackage(); this.mockServiceProvider = new Mock <IServiceProvider>(MockBehavior.Strict); this.violation = CreateDummyViolationInfo(); this.package.Core.DisplayUI = false; this.taskUnderTest = new ViolationTask(this.package, this.violation, null); this.taskUnderTestShell = taskUnderTest; }