Exemple #1
0
        public void ClassWithEnumFromUnrelatedClass()
        {
            var c = new Copier();

            c.AddType(typeof(MockRequest));
            c.AddType(typeof(OtherMockRequest));
            c.AddType(typeof(MockResponse));
            var r = c.Process();

            Console.WriteLine(r);
        }
Exemple #2
0
        public void TokenTest()
        {
            var settings = new CopierSettings();

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            var c = new Copier(settings);

            c.LimitOutputToAssemblyOfType(typeof(AccountRequest));
            c.AddType(typeof(AccountRequest));
            c.AddType(typeof(AccountResponse));
            var r = c.Process();

            Console.WriteLine(r);
        }
Exemple #3
0
        public string ModelDuplicator()
        {
            (string, string)replaceWith = ($"Gtt.Links.Core", $"Gtt.Links.Client");
            var settings = new CopierSettings();

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            settings.BaseTypesToRemove.Add(typeof(BaseStatefulServiceInstance <, , , ,>));
            var mt = new Copier(settings)
            {
                AlwaysGetAndSet  = true,
                ReplaceNamespace = replaceWith
            };

            mt.LimitOutputToAssemblyOfType(typeof(HealthCheckRequest));

            foreach (var instance in _instances)
            {
                mt.AddType(instance.RequestType);
                mt.AddType(instance.ResponseType);
            }

            return(mt.Process());
        }
Exemple #4
0
        public void ServiceTestWithReplacementType()
        {
            var settings = new CopierSettings
            {
                ReplacementTypes =
                {
                    { typeof(TokenDate),   typeof(DateTime) },
                    { typeof(TokenString), typeof(string)   },
                }
            };

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            var c = new Copier(settings);

            c.LimitOutputToAssemblyOfType(typeof(TokenRequest));
            c.AddType(typeof(TokenRequest));
            var r = c.Process();

            Console.WriteLine(r);
        }
Exemple #5
0
        public void BasicClassTest()
        {
            var c = new Copier();

            //c.LimitOutputToAssemblyOfType(typeof(Common.Models.Root));
            c.AddType(typeof(GenericBase));
            c.AddType(typeof(Basic));
            c.AddType(typeof(ServiceResponse <CompoundResponse>));
            c.AddType(typeof(MockRequest));
            c.AddType(typeof(OtherMockRequest));
            c.AddType(typeof(MockResponse));
            var r = c.Process();

            Console.WriteLine(r);
        }