Example #1
0
        public void Default_Convention_Test()
        {
            var pairs = GooseTypePairs.Scan(options =>
            {
                options.FromAssemblyOf <Duck>().ToAssemblyOf <Duck>().WithDefaultConvention();
            });

            Assert.True(CheckPairs(pairs, new GooseTypePair[] { GooseTypePair.Create <Duck, IDuck>() }));
        }
Example #2
0
        public void Convention_Test()
        {
            var pairs = GooseTypePairs.Scan(options =>
            {
                options.FromAssemblyOf <Duck>().ToAssemblyOf <Duck>().WithConvention((sourceType, targetType)
                                                                                     => targetType.Name == "IStandard" + sourceType.Name);
            });

            Assert.True(CheckPairs(pairs, new GooseTypePair[] { GooseTypePair.Create <Fish, IStandardFish>() }));
        }