public void CreateAddsItemToDb()
    {
      var fixture = new Fixture();
      var db = fixture.Freeze<Db>();
      var item = fixture.Build<DbItem>().Without(x => x.ParentID).Create();
      var sut = new AddContentDbItemCommand();

      sut.Execute(item, new SpecimenContext(fixture));

      db.GetItem(item.ID).Should().NotBeNull();
    }
Example #2
0
        public void CreateAddsItemToDb()
        {
            var fixture = new Fixture();
            var db      = fixture.Freeze <Db>();
            var item    = fixture.Build <DbItem>().Without(x => x.ParentID).Create();
            var sut     = new AddContentDbItemCommand();

            sut.Execute(item, new SpecimenContext(fixture));

            db.GetItem(item.ID).Should().NotBeNull();
        }
 public void ExecuteIgnoresNotDbItemSpecimens(AddContentDbItemCommand sut, object specimen, SpecimenContext context)
 {
   Action action = () => sut.Execute(specimen, context);
   action.ShouldNotThrow();
 }
 public void ExecuteThrowsIfContextIsNull(AddContentDbItemCommand sut, object specimen)
 {
   Action action = () => sut.Execute(specimen, null);
   action.ShouldThrow<ArgumentNullException>().WithMessage("*context");
 }
 public void ExecuteThrowsIfSpecimenIsNull(AddContentDbItemCommand sut)
 {
   Action action = () => sut.Execute(null, null);
   action.ShouldThrow<ArgumentNullException>().WithMessage("*specimen");
 }
Example #6
0
        public void ExecuteIgnoresNotDbItemSpecimens(AddContentDbItemCommand sut, object specimen, SpecimenContext context)
        {
            Action action = () => sut.Execute(specimen, context);

            action.ShouldNotThrow();
        }
Example #7
0
        public void ExecuteThrowsIfContextIsNull(AddContentDbItemCommand sut, object specimen)
        {
            Action action = () => sut.Execute(specimen, null);

            action.ShouldThrow <ArgumentNullException>().WithMessage("*context");
        }
Example #8
0
        public void ExecuteThrowsIfSpecimenIsNull(AddContentDbItemCommand sut)
        {
            Action action = () => sut.Execute(null, null);

            action.ShouldThrow <ArgumentNullException>().WithMessage("*specimen");
        }