public void InitializeTest() { var serviceProvider = new MockServiceProvider(); UpdateSolutionListener target = new UpdateSolutionListener(serviceProvider); target.Initialize(); uint expected = 1; Assert.AreEqual(expected, expected, (uint)target.GetType() .GetField("eventsCookie", BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(target)); }
public void InitializeTest() { try { var serviceProvider = new MockServiceProvider(); UpdateSolutionListener target = new UpdateSolutionListener(serviceProvider); target.Initialize(); PrivateObject updateSolutionListener = new PrivateObject(target, new PrivateType(typeof(UpdateSolutionListener))); uint expected = 1; Assert.AreEqual(expected, updateSolutionListener.GetFieldOrProperty("eventsCookie")); } catch (Exception ex) { // Use try catch to test a workaround on CI build (AppVeyor) Console.WriteLine(ex.Message); } }
public void InitializeTest() { var serviceProvider = new MockServiceProvider(); UpdateSolutionListener target = new UpdateSolutionListener(serviceProvider); target.Initialize(); PrivateObject updateSolutionListener = new PrivateObject(target, new PrivateType(typeof(UpdateSolutionListener))); uint expected = 1; Assert.AreEqual(expected, updateSolutionListener.GetFieldOrProperty("eventsCookie")); }