public void throw_no_subscription_found_exception_when_adding_a_subscription() { var stateManager = new StateValueManagement(); stateManager.AddStateValue(new StateValue("sentinel1", "package1", "statename", 3, TypeOfValue.Int)); var subscriptionManager = new SubscriptionStateValueManagement(stateManager); var subscriptionId = subscriptionManager.AddSubscription(new SentinelKey("sentinel.package"), "sentinel1", "package1", "statename"); Check.ThatCode(() => subscriptionManager.RemoveSubscription(new SentinelKey("sentinel.package1"), subscriptionId) ).Throws <NoSubscriptionFoundException>(); }
public void return_0_when_adding_and_then_remove_subscription() { var stateManager = new StateValueManagement(); stateManager.AddStateValue(new StateValue("sentinel1", "package1", "statename", 3, TypeOfValue.Int)); var subscriptionManager = new SubscriptionStateValueManagement(stateManager); var subscriptionId = subscriptionManager.AddSubscription(new SentinelKey("sentinel.package"), "sentinel1", "package1", "statename"); subscriptionManager.RemoveSubscription(new SentinelKey("sentinel.package"), subscriptionId); Check.That(subscriptionManager.GetAllSubscriptions().Count).IsEqualTo(0); }