public void XmlRepoTests_Can_CRUD_Baum() { var baum = new Tannenbaum() { Height = 17 }; var newHeight = 452; {//INSERT var repo = new XmlRepository(); repo.Add(baum); repo.Save(); } {//check Read var repo = new XmlRepository(); Assert.IsTrue(repo.GetAll <Tannenbaum>().Any(x => x.Height == baum.Height)); var loaded = repo.GetById <Tannenbaum>(baum.Id); Assert.IsNotNull(loaded); Assert.AreEqual(baum.Height, loaded.Height); //UPDATE loaded.Height = 452; repo.Save(); } {//check UPDATE + DELETE var repo = new XmlRepository(); var loaded = repo.GetById <Tannenbaum>(baum.Id); Assert.AreEqual(newHeight, loaded.Height); repo.Delete(loaded); repo.Save(); } {//check DELETE var repo = new XmlRepository(); var loaded = repo.GetById <Tannenbaum>(baum.Id); Assert.IsNull(loaded); } }