Exemplo n.º 1
0
        public void Extensions_has_public_extension_methods()
        {
            // We expect that all methods on the interface are also present on Extensions.
            var signatures = ApiSupport.SignatureSet(CompatibleMethods);
            var methods    =
                typeof(Extensions).GetMethods().Where(
                    m => m.Name == APIName && m.ReturnType == typeof(void)
                    );

            if (HasStringExpectations)
            {
                // We could have explicit string handling so that the user can benefit from
                // string-specific handling, but we don't care about these API differences
                methods = methods.Where(
                    m => m.GetParameters()[0].ParameterType != typeof(IExpectation <string>) &&
                    m.GetParameters()[0].ParameterType != typeof(IExpectation <string>)
                    );
            }
            var actual = ApiSupport.SignatureSet(methods);

            Assert.SetEqual(
                signatures,
                actual,
                $"Expected to have signature Extensions.{APIName}"
                );
        }
        public void Extensions_has_public_extension_methods()
        {
            // We expect that all methods on the interface are also present on Extensions.
            var signatures = ApiSupport.SignatureSet(CompatibleMethods);
            var actual     = ApiSupport.SignatureSet(
                typeof(Extensions).GetMethods().Where(
                    m => m.Name == APIName && m.ReturnType == typeof(void)
                    )
                );

            Assert.SetEqual(
                signatures,
                actual,
                $"Expected to have signature Extensions.{APIName}"
                );
        }