public void Init() { // Create the basic actor instances and behavior for test. this.witnessThing = new Thing() { Name = "WitnessThing", ID = TestThingID.Generate("testthing") }; this.actingThing = new Thing() { Name = "ActingThing", ID = TestThingID.Generate("testthing") }; this.lockableThing = new Thing() { Name = "LockableThing", ID = TestThingID.Generate("testthing") }; this.locksUnlocksBehavior = new LocksUnlocksBehavior(); // Set up the actors inside another (which we'll call a "room" although it needn't actually be a room). this.room = new Thing() { Name = "Room", ID = TestThingID.Generate("room") }; this.room.Add(witnessThing); this.room.Add(actingThing); this.room.Add(lockableThing); // Prepare to verify correct eventing occurs. this.witnessThing.Eventing.MiscellaneousRequest += (root, e) => { this.lastWitnessRequest = e; }; this.witnessThing.Eventing.MiscellaneousEvent += (root, e) => { this.lastWitnessEvent = e; }; this.actingThing.Eventing.MiscellaneousRequest += (root, e) => { this.lastActorRequest = e; }; this.actingThing.Eventing.MiscellaneousEvent += (root, e) => { this.lastActorEvent = e; }; }
/// <summary>Initializes a new instance of the LocksUnlocksBehaviorCommands class.</summary> /// <param name="locksUnlocksBehavior">The OpensClosesBehavior this class belongs to.</param> public LocksUnlocksBehaviorCommands(LocksUnlocksBehavior locksUnlocksBehavior) : base() { this.locksUnlocksBehavior = locksUnlocksBehavior; }
/// <summary> /// Initializes a new instance of the LocksUnlocksBehaviorCommands class. /// </summary> /// <param name="locksUnlocksBehavior">The OpensClosesBehavior this class belongs to.</param> public LocksUnlocksBehaviorCommands(LocksUnlocksBehavior locksUnlocksBehavior) : base() { this.locksUnlocksBehavior = locksUnlocksBehavior; }