public void RegisterError_Should_AddErrors_And_AssignDifferentIds()
        {
            var context = new ScopeBuilderContext();

            var error1 = new Error();
            var error2 = new Error();
            var error3 = new Error();

            var errorId1 = context.RegisterError(error1);
            var errorId2 = context.RegisterError(error2);
            var errorId3 = context.RegisterError(error3);

            context.Errors.Count.Should().Be(6);

            context.Errors.Keys.Should().Contain(errorId1);
            context.Errors[errorId1].Should().BeSameAs(error1);

            context.Errors.Keys.Should().Contain(errorId2);
            context.Errors[errorId2].Should().BeSameAs(error2);

            context.Errors.Keys.Should().Contain(errorId3);
            context.Errors[errorId3].Should().BeSameAs(error3);

            context.Scopes.Should().BeEmpty();
            context.Types.Should().BeEmpty();
        }
        public void RegisterError_Should_ThrowException_NullError()
        {
            var context = new ScopeBuilderContext();

            Action action = () => context.RegisterError(null);

            action.Should().ThrowExactly <ArgumentNullException>();
        }
        public void RegisterError_Should_AddError()
        {
            var context = new ScopeBuilderContext();

            var error = new Error();

            var errorId = context.RegisterError(error);

            context.Errors.Count.Should().Be(4);
            context.Errors.Keys.Should().Contain(errorId);

            context.Errors[errorId].Should().BeSameAs(error);

            context.Scopes.Should().BeEmpty();
            context.Types.Should().BeEmpty();
        }