コード例 #1
0
        public void Apply()
        {
            MixAttribute attribute = new MixAttribute(typeof(object), typeof(float));

            _configurationBuilderMock
            .Expect(
                mock => mock.AddMixinToClass(
                    MixinKind.Extending,
                    typeof(object),
                    typeof(float),
                    MemberVisibility.Private,
                    attribute.AdditionalDependencies,
                    attribute.SuppressedMixins,
                    CreateExpectedOrigin(attribute)))
            .Return(null);

            _mockRepository.ReplayAll();
            attribute.Apply(_configurationBuilderMock, _assembly);
            _mockRepository.VerifyAll();
        }
コード例 #2
0
        public void Apply_InvalidOperation()
        {
            MixAttribute attribute = new MixAttribute(typeof(object), typeof(float));

            attribute.SuppressedMixins       = new[] { typeof(int) };
            attribute.AdditionalDependencies = new[] { typeof(string) };

            _configurationBuilderMock
            .Expect(
                mock => mock.AddMixinToClass(
                    MixinKind.Extending,
                    typeof(object),
                    typeof(float),
                    MemberVisibility.Private,
                    attribute.AdditionalDependencies,
                    attribute.SuppressedMixins,
                    CreateExpectedOrigin(attribute)))
            .Throw(new InvalidOperationException("Supper?"));

            _mockRepository.ReplayAll();
            attribute.Apply(_configurationBuilderMock, _assembly);
        }