public void DialogService_EndConversation_ShouldBeMarkedAsEnding() { INWScript script = Substitute.For <INWScript>(); INWNXCreature nwnxCreature = Substitute.For <INWNXCreature>(); DialogService service = new DialogService( script, new AppState() ); NWPlayer player = Substitute.For <NWPlayer>(script, nwnxCreature); player.GlobalID.Returns(x => "123"); NWObject talkTo = Substitute.For <NWObject>(script); service.LoadConversation(player, talkTo, "ValidConversation", 1); PlayerDialog dialog = service.LoadPlayerDialog("123"); service.EndConversation(player); Assert.AreEqual(true, dialog.IsEnding); }
public void DialogService_EndConversation_InvalidArguments_ShouldThrowException() { INWScript script = Substitute.For <INWScript>(); INWNXCreature nwnxCreature = Substitute.For <INWNXCreature>(); DialogService service = new DialogService( script, new AppState() ); NWPlayer player = Substitute.For <NWPlayer>(script, nwnxCreature); player.GlobalID.Returns(x => "123"); NWObject talkTo = Substitute.For <NWObject>(script); service.LoadConversation(player, talkTo, "ValidConversation", 1); Assert.Throws(typeof(ArgumentNullException), () => { service.EndConversation(null); }); }
protected void EndConversation() { DialogService.EndConversation(GetPC()); }