private DoTwoDBOperation_Create ( bool throwException ) : void | ||
throwException | bool | |
리턴 | void |
public void ExceptionOnEndWithTwoDatabases() { RootService service = container.Resolve <RootService>(); OrderDao orderDao = container.Resolve <OrderDao>("myorderdao"); try { service.DoTwoDBOperation_Create(true); } catch (InvalidOperationException) { // Expected } Array blogs = service.FindAll(typeof(Blog)); Array blogitems = service.FindAll(typeof(BlogItem)); Array orders = orderDao.FindAll(typeof(Order)); Assert.IsNotNull(blogs); Assert.IsNotNull(blogitems); Assert.IsNotNull(orders); Assert.AreEqual(0, blogs.Length); Assert.AreEqual(0, blogitems.Length); Assert.AreEqual(0, orders.Length); }
public void SuccessfulSituationWithTwoDatabases() { RootService service = container.Resolve <RootService>(); OrderDao orderDao = container.Resolve <OrderDao>("myorderdao"); service.DoTwoDBOperation_Create(false); Array blogs = service.FindAll(typeof(Blog)); Array blogitems = service.FindAll(typeof(BlogItem)); Array orders = orderDao.FindAll(typeof(Order)); Assert.IsNotNull(blogs); Assert.IsNotNull(blogitems); Assert.IsNotNull(orders); Assert.AreEqual(1, blogs.Length); Assert.AreEqual(1, blogitems.Length); Assert.AreEqual(1, orders.Length); }