public Form1() { InitializeComponent(); TweenShark.Initialize(new TweenSharkWinformsTick(), new ConsoleLogger()); TweenShark.RegisterPropertyTweener(typeof(ColorTweener), typeof(Color)); Deactivate += (sender, e) => Destroy(GetForegroundWindow()); this.Click += (sender, e) => { }; // this.BackgroundImage = Resources.background; // // this.FormBorderStyle = FormBorderStyle.None; // this.TransparencyKey = Color.FromArgb(255, 0, 255); button1.MouseEnter += HandleButtonMouseEnter; button1.MouseLeave += HandleButtonMouseLeave; button2.MouseEnter += HandleButtonMouseEnter; button2.MouseLeave += HandleButtonMouseLeave; }
public void InitializeTest() { TweenShark.Initialize(new TweenSharkTickImpl(), new NullLogger()); var type = typeof(TweenShark); var info = type.GetField("_core", BindingFlags.NonPublic | BindingFlags.Static); var core = (TweenSharkCore)info.GetValue(null); // the core must be created Assert.IsInstanceOfType(core, typeof(TweenSharkCore)); var param0 = new PrivateObject(core); var accessor = new TweenSharkCore_Accessor(param0); // the standard property tweeners must be registered Assert.AreEqual(10, accessor._registeredPropertyTweeners.Count); // check that all tweeners are registerd correctly Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(SByte).FullName], typeof(SignedByteTweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Int16).FullName], typeof(SignedInt16Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Int32).FullName], typeof(SignedInt32Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Int64).FullName], typeof(SignedInt64Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Byte).FullName], typeof(UnsignedByteTweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(UInt16).FullName], typeof(UnsignedInt16Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(UInt32).FullName], typeof(UnsignedInt32Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(UInt64).FullName], typeof(UnsignedInt64Tweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Single).FullName], typeof(FloatTweener)); Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(Double).FullName], typeof(DoubleTweener)); }
public void RegisterPropertyTweenerTest() { TweenShark.Initialize(new TweenSharkTickImpl(), new NullLogger()); var type = typeof(TweenShark); var info = type.GetField("_core", BindingFlags.NonPublic | BindingFlags.Static); var core = (TweenSharkCore)info.GetValue(null); // the core must be created Assert.IsInstanceOfType(core, typeof(TweenSharkCore)); var param0 = new PrivateObject(core); var accessor = new TweenSharkCore_Accessor(param0); var beforeCount = accessor._registeredPropertyTweeners.Count; // if we overwrite an existing type the number of registered tweeners must not change TweenShark.RegisterPropertyTweener(typeof(SimpleTweenerImpl <SByte>), typeof(SByte)); Assert.AreEqual(beforeCount, accessor._registeredPropertyTweeners.Count); // the tweener for sbyte must be overwritten Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(SByte).FullName], typeof(SimpleTweenerImpl <SByte>)); // if we overwrite an existing type the number of registered tweeners must change TweenShark.RegisterPropertyTweener(typeof(SimpleTweenerImpl <SByte>), typeof(TweeningTestObject)); Assert.AreEqual(beforeCount + 1, accessor._registeredPropertyTweeners.Count); // the tweener for sbyte must be overwritten Assert.AreEqual(accessor._registeredPropertyTweeners[typeof(TweeningTestObject).FullName], typeof(SimpleTweenerImpl <SByte>)); }
public void MyTestInitialize() { TweenShark.Initialize(new TweenSharkTickImpl(), new ConsoleLogger()); }