Example #1
0
        public async Task <object> SetNonClientMetrics(dynamic input)
        {
            var ncm = new NonClientMetrics();

            ncm.UseSettings(input);
            ncm.Apply();
            return(new NonClientMetrics());
        }
Example #2
0
        public void TestUseOfDynamic()
        {
            dynamic settings = new ExpandoObject();

            settings.BorderWidth = 10;
            settings.ScrollWidth = 20;

            NonClientMetrics ncmOriginal = new NonClientMetrics();

            NonClientMetrics ncmModifier = new NonClientMetrics();

            ncmModifier.UseSettings(settings);
            ncmModifier.Apply();

            var ncmAssert = new NonClientMetrics();

            Assert(ncmAssert.BorderWidth == settings.BorderWidth);
            Assert(ncmAssert.ScrollWidth == settings.ScrollWidth);

            ncmOriginal.Apply();
            ncmAssert = new NonClientMetrics();
            Assert(ncmAssert.BorderWidth == ncmOriginal.BorderWidth);
            Assert(ncmAssert.ScrollWidth == ncmOriginal.ScrollWidth);
        }