コード例 #1
0
        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));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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);
            }
        }