Exemplo n.º 1
0
        protected override void Establish_context()
        {
            base.Establish_context();
            this._insertRepository = new Mock <ICreateRepository <Blog> >();
            this._updateRepository = new Mock <IUpdateRepository <Blog> >();

            this._blogCommandHandler = new BlogCommandHandler(this._insertRepository.Object, this._updateRepository.Object);
        }
        protected override void Establish_context()
        {
            base.Establish_context();
            this._insertRepository = new Mock<ICreateRepository<Blog>>();
            this._updateRepository = new Mock<IUpdateRepository<Blog>>();

            this._blogCommandHandler = new BlogCommandHandler(this._insertRepository.Object, this._updateRepository.Object);
        }
        public void then_if_the_update_repository_is_null_contract_exception_is_thrown()
        {
            var expected = "Precondition failed: updateRepository != null";
            var actual = string.Empty;
            try
            {
                this._blogCommandHandler = new BlogCommandHandler(this._insertRepository.Object, null);
            }
            catch (Exception e)
            {
                actual = e.Message;
            }

            actual.ShouldEqual(expected);
        }
Exemplo n.º 4
0
        public void then_if_the_update_repository_is_null_contract_exception_is_thrown()
        {
            var expected = "Precondition failed: updateRepository != null";
            var actual   = string.Empty;

            try
            {
                this._blogCommandHandler = new BlogCommandHandler(this._insertRepository.Object, null);
            }
            catch (Exception e)
            {
                actual = e.Message;
            }

            actual.ShouldEqual(expected);
        }