示例#1
0
        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);
        }
示例#2
0
        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);
            });
        }
示例#3
0
 protected void EndConversation()
 {
     DialogService.EndConversation(GetPC());
 }