public void CreateAddsItemToDb() { var fixture = new Fixture(); var db = fixture.Freeze<Db>(); fixture.Inject(db.Database); var item = fixture.Freeze<Item>(x => x.OmitAutoProperties()); var sut = new AddContentItemCommand(); sut.Execute(item, new SpecimenContext(fixture)); db.GetItem(item.ID).Should().NotBeNull(); }
public void CreateAddsItemToDb() { var fixture = new Fixture(); var db = fixture.Freeze <Db>(); fixture.Inject(db.Database); var item = fixture.Freeze <Item>(x => x.OmitAutoProperties()); var sut = new AddContentItemCommand(); sut.Execute(item, new SpecimenContext(fixture)); db.GetItem(item.ID).Should().NotBeNull(); }
public void ExecuteIgnoresNotDbItemSpecimens(AddContentItemCommand sut, object specimen, SpecimenContext context) { Action action = () => sut.Execute(specimen, context); action.ShouldNotThrow(); }
public void ExecuteThrowsIfContextIsNull(AddContentItemCommand sut, object specimen) { Action action = () => sut.Execute(specimen, null); action.ShouldThrow<ArgumentNullException>().WithMessage("*context"); }
public void ExecuteThrowsIfSpecimenIsNull(AddContentItemCommand sut) { Action action = () => sut.Execute(null, null); action.ShouldThrow<ArgumentNullException>().WithMessage("*specimen"); }
public void ExecuteIgnoresNotDbItemSpecimens(AddContentItemCommand sut, object specimen, SpecimenContext context) { Action action = () => sut.Execute(specimen, context); action.ShouldNotThrow(); }
public void ExecuteThrowsIfContextIsNull(AddContentItemCommand sut, object specimen) { Action action = () => sut.Execute(specimen, null); action.ShouldThrow <ArgumentNullException>().WithMessage("*context"); }
public void ExecuteThrowsIfSpecimenIsNull(AddContentItemCommand sut) { Action action = () => sut.Execute(null, null); action.ShouldThrow <ArgumentNullException>().WithMessage("*specimen"); }