public void ResolveItem_NoId_ThrowsException() { //Arrange var config = new SitecoreTypeConfiguration(); config.Type = typeof(StubClassNoId); config.AddProperty( new SitecoreFieldConfiguration() { PropertyInfo = typeof(StubClassNoId).GetProperty("Field") }); var instance = new StubClassNoId(); var database = Factory.GetDatabase("master"); //Act var result = config.ResolveItem(instance, database); //Assert }
public void ResolveItem_NoId_ThrowsException() { //Arrange using (Db database = new Db { new Sitecore.FakeDb.DbItem("TestItem") }) { var config = new SitecoreTypeConfiguration(); config.Type = typeof(StubClassNoId); config.AddProperty( new SitecoreFieldConfiguration() { PropertyInfo = typeof(StubClassNoId).GetProperty("Field") }); var instance = new StubClassNoId(); //Act Assert.Throws <NotSupportedException>(() => config.ResolveItem(instance, database.Database)); //Assert } }
public void ResolveItem_NoId_ThrowsException() { //Arrange var config = new SitecoreTypeConfiguration(); config.Type = typeof (StubClassNoId); config.AddProperty( new SitecoreFieldConfiguration() { PropertyInfo = typeof (StubClassNoId).GetProperty("Field") }); var instance = new StubClassNoId(); var database = Factory.GetDatabase("master"); //Act var result = config.ResolveItem(instance, database); //Assert }
public void ResolveItem_NoId_ThrowsException() { //Arrange using (Db database = new Db { new Sitecore.FakeDb.DbItem("TestItem") }) { var config = new SitecoreTypeConfiguration(); config.Type = typeof(StubClassNoId); config.AddProperty( new SitecoreFieldConfiguration() { PropertyInfo = typeof(StubClassNoId).GetProperty("Field") }); var instance = new StubClassNoId(); //Act Assert.Throws<NotSupportedException>(() => config.ResolveItem(instance, database.Database)); //Assert } }