AutoMoq.Tests.MockingBehaviorTests.It_should_allow_a_mock_to_be_changed_on_a_mock_by_mock_basis C# (CSharp) Method

It_should_allow_a_mock_to_be_changed_on_a_mock_by_mock_basis() private method

        public void It_should_allow_a_mock_to_be_changed_on_a_mock_by_mock_basis()
        {
            var mocker = new AutoMoqer();

            mocker.GetMock<IFoo>(MockBehavior.Loose);
            mocker.GetMock<IFooFoo>(MockBehavior.Strict);

            var bar = mocker.Create<BarBar>();

            bar.ThrowFoo(); // this one is loose, so it should not throw

            var anErrorWasThrown = false;
            try
            {
                bar.ThrowFooFoo(); // this one is strict, so it should throw
            }
            catch
            {
                anErrorWasThrown = true;
            }
            anErrorWasThrown.ShouldBeTrue();
        }