public void UpdateStaticMethodWithChanges()
        {
            var method = Helper.GetMethod("PublicMethodTestClass", "UpdateStaticMethod");

            Runtime.HandleCodeChange(new Core.CodeChange
            {
                Methods = new System.Collections.Generic.List <Core.Method>
                {
                    method
                }
            });

            PublicMethodTestClass.UpdateStaticMethod();

            Tracker.LastValue.Should().Be("change");
        }
        public void AddedStaticMethodAndCalledFromSameClass()
        {
            var existingMethod = Helper.GetMethod("PublicMethodTestClass", "AddedStaticMethodAndCalledFromSameClass1");
            var newMethod      = Helper.GetMethod("PublicMethodTestClass", "AddedStaticMethodAndCalledFromSameClass2");

            Runtime.HandleCodeChange(new Core.CodeChange
            {
                Methods = new System.Collections.Generic.List <Core.Method>
                {
                    newMethod, existingMethod
                }
            });

            PublicMethodTestClass.AddedStaticMethodAndCalledFromSameClass1();

            Tracker.LastValue.Should().Be("change");
        }
        public void MethodOverload2()
        {
            var method1 = Helper.GetMethod("PublicMethodTestClass", HotReloading.Core.Helper.GetMethodKey("MethodOverload"));
            var method2 = Helper.GetMethod("PublicMethodTestClass", HotReloading.Core.Helper.GetMethodKey("MethodOverload", typeof(string).FullName));

            Runtime.HandleCodeChange(new Core.CodeChange
            {
                Methods = new System.Collections.Generic.List <Core.Method>
                {
                    method1, method2
                }
            });

            PublicMethodTestClass.MethodOverload("test");

            Tracker.LastValue.Should().Be("overload2");
        }
        public void AddedStaticMethodAndCalledFromInstanceMethod()
        {
            var instanceMethod = Helper.GetMethod("PublicMethodTestClass", "AddedStaticMethodAndCalledFromInstanceMethod");
            var newMethod      = Helper.GetMethod("PublicMethodTestClass", "AddedStaticMethodAndCalledFromInstanceMethod1");

            Runtime.HandleCodeChange(new Core.CodeChange
            {
                Methods = new System.Collections.Generic.List <Core.Method>
                {
                    instanceMethod, newMethod
                }
            });

            var instance = new PublicMethodTestClass();

            instance.AddedStaticMethodAndCalledFromInstanceMethod();

            Tracker.LastValue.Should().Be("change");
        }
        public void UpdateStaticMethodWithoutChanges()
        {
            PublicMethodTestClass.UpdateStaticMethod();

            Tracker.LastValue.Should().Be("default");
        }