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); }