public void CommandBinding_InLocal() { // Arrange var container = new CommandContainerTest(); var key = typeof(object); var binder = new CommandBinding(container, key, null, null); // Act binder.InLocal(); var actual = binder.LifeTime; // Assert Assert.AreEqual(LifeTime.Local, actual); }
public void CommandBinding_InLocal_Exception() { // Arrange var actual = false; var container = new CommandContainerTest(); var key = typeof(object); var binder = new CommandBinding(container, key, null, null); binder.InLocal(); // Act try { binder.InLocal(); } catch (InvalidOperationException) { actual = true; } // Assert Assert.IsTrue(actual); }