Пример #1
0
    public void TestRegen()
    {
        string xml =
            @"<regen name=""health"" next=""12313231"" />";

        bool eventTriggered = false;

        System.Xml.XmlElement           nn       = RoarExtensions.CreateXmlElement(xml);
        Action <Roar.Events.RegenEvent> callback = (Roar.Events.RegenEvent eve) =>
        {
            eventTriggered = true;
            StringAssert.IsMatch(eve.name, "health");
            StringAssert.IsMatch(eve.next, "12313231");
        };

        RoarManager.roarServerRegenEvent += callback;

        try
        {
            RoarManager.OnServerEvent(nn);
        }
        finally
        {
            RoarManager.roarServerRegenEvent -= callback;
        }

        Assert.IsTrue(eventTriggered);
    }
Пример #2
0
    public void TestLevelUp()
    {
        string xml =
            @"<level_up value=""5"" />";

        bool eventTriggered = false;

        System.Xml.XmlElement             nn       = RoarExtensions.CreateXmlElement(xml);
        Action <Roar.Events.LevelUpEvent> callback = (Roar.Events.LevelUpEvent eve) =>
        {
            eventTriggered = true;
            StringAssert.IsMatch(eve.val, "5");
        };

        RoarManager.roarServerLevelUpEvent += callback;

        try
        {
            RoarManager.OnServerEvent(nn);
        }
        finally
        {
            RoarManager.roarServerLevelUpEvent -= callback;
        }

        Assert.IsTrue(eventTriggered);
    }
Пример #3
0
    public void TestUpdate()
    {
        string xml =
            @"<update type=""core"" ikey=""health"" value=""120"" />";

        bool eventTriggered = false;

        System.Xml.XmlElement            nn       = RoarExtensions.CreateXmlElement(xml);
        Action <Roar.Events.UpdateEvent> callback = (Roar.Events.UpdateEvent eve) =>
        {
            eventTriggered = true;
            StringAssert.IsMatch(eve.ikey, "health");
            StringAssert.IsMatch(eve.type, "core");
            StringAssert.IsMatch(eve.val, "120");
        };

        RoarManager.roarServerUpdateEvent += callback;

        try
        {
            RoarManager.OnServerEvent(nn);
        }
        finally
        {
            RoarManager.roarServerUpdateEvent -= callback;
        }

        Assert.IsTrue(eventTriggered);
    }
Пример #4
0
    public void TestItemAdd()
    {
        string xml =
            @"<item_add item_id=""1234"" item_ikey=""somthing""/>";

        bool eventTriggered = false;

        System.Xml.XmlElement             nn       = RoarExtensions.CreateXmlElement(xml);
        Action <Roar.Events.ItemAddEvent> callback = (Roar.Events.ItemAddEvent eve) =>
        {
            eventTriggered = true;
            StringAssert.IsMatch(eve.item_id, "1234");
            StringAssert.IsMatch(eve.item_ikey, "somthing");
        };

        RoarManager.roarServerItemAddEvent += callback;

        try
        {
            RoarManager.OnServerEvent(nn);
        }
        finally
        {
            RoarManager.roarServerItemAddEvent -= callback;
        }

        Assert.IsTrue(eventTriggered);
    }
Пример #5
0
    public void TestInventoryChanged()
    {
        string xml =
            @"<inventory_changed />";

        bool eventTriggered = false;

        System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
        Action <Roar.Events.InventoryChangedEvent> callback = (Roar.Events.InventoryChangedEvent eve) =>
        {
            eventTriggered = true;
        };

        RoarManager.roarServerInventoryChangedEvent += callback;

        try
        {
            RoarManager.OnServerEvent(nn);
        }
        finally
        {
            RoarManager.roarServerInventoryChangedEvent -= callback;
        }

        Assert.IsTrue(eventTriggered);
    }
Пример #6
0
        public void TestTasksListParseMechanics()
        {
            string xml =
                @"<roar tick=""135577684654"">
				<tasks>
					<list status=""ok"">
						<task ikey=""dungeon_crawl"">
							<label>Dungeon crawl</label>
							<description>Go into the pits</description>
							<location>Australia</location>
							<tags>
								<tag value=""protect""/>
								<tag value=""monsters""/>
							</tags>
							<costs>
								<item_cost ikey=""mariner"" number_required=""3"" ok=""false"" reason=""requires mariner(3)""/>
								<stat_cost type=""currency"" ikey=""premium_currency"" value=""477"" ok=""true""/>
							</costs>
							<rewards>
								<grant_stat type=""currency"" ikey=""premium_currency"" value=""453""/>
								<grant_xp value=""234""/>
							</rewards>
							<mastery level=""2"" progress=""5""/>
							<requires>
								<item_requirement ikey=""talisman"" number_required=""2"" ok=""false"" reason=""requires talisman(2)""/>
							</requires>
						</task>
					</list>
				</tasks>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Mockery mockery          = new Mockery();

            Roar.DataConversion.IXCRMParser          ixcrm_parser = mockery.NewMock <Roar.DataConversion.IXCRMParser>();
            Roar.DataConversion.Responses.Tasks.List list_parser  = new Roar.DataConversion.Responses.Tasks.List();
            list_parser.ixcrm_parser = ixcrm_parser;
            Roar.DomainObjects.Task task_data = new Roar.DomainObjects.Task();

            Expect.Once.On(ixcrm_parser).Method("ParseCostList").With(nn.SelectSingleNode("./tasks/list/task/costs")).Will(Return.Value(task_data.costs));
            Expect.Once.On(ixcrm_parser).Method("ParseModifierList").With(nn.SelectSingleNode("./tasks/list/task/rewards")).Will(Return.Value(task_data.rewards));
            Expect.Once.On(ixcrm_parser).Method("ParseRequirementList").With(nn.SelectSingleNode("./tasks/list/task/requires")).Will(Return.Value(task_data.requirements));
            Expect.Once.On(ixcrm_parser).Method("ParseTagList").With(nn.SelectSingleNode("./tasks/list/task/tags")).Will(Return.Value(task_data.tags));

            ListResponse response = list_parser.Build(nn);

            mockery.VerifyAllExpectationsHaveBeenMet();

            Assert.AreEqual(response.tasks.Count, 1);
            Assert.AreEqual(response.tasks[0].costs.Count, 0);
            Assert.AreEqual(response.tasks[0].rewards.Count, 0);
            Assert.AreEqual(response.tasks[0].requirements.Count, 0);
            Assert.AreEqual(response.tasks[0].tags.Count, 0);
            Assert.AreEqual(response.tasks[0].costs, task_data.costs);
            Assert.AreEqual(response.tasks[0].rewards, task_data.rewards);
            Assert.AreEqual(response.tasks[0].requirements, task_data.requirements);
            Assert.AreEqual(response.tasks[0].tags, task_data.tags);
        }
Пример #7
0
        public void TestWhatCanIAcceptParseMechanics()
        {
            string xml =
                @"<roar tick=""128555554651"">
				<mail>
					<what_can_i_accept status=""ok"">
						<package type=""item"" id=""15850999291750564699"" message=""Enjoy the beans!"" sender_id=""123123"" sender_name=""John"">
							<item id=""15850999291750564699"" ikey=""magic_beans"" count=""1"" label=""Magic Beans"" type=""custom_type"" description=""Grow a beanstalk!"" consumable=""true""/>
							<tag value=""test_tag""/>
							<tag value=""next tag""/>
							<modifiers>
								<grant_item ikey=""item_ikey_1""/>
							</modifiers>
						</package>
					</what_can_i_accept>
				</mail>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Mail.WhatCanIAccept what_can_i_accept_parser = new Roar.DataConversion.Responses.Mail.WhatCanIAccept();

            Mockery mockery = new Mockery();

            Roar.DataConversion.IXCRMParser ixcrm_parser = mockery.NewMock <Roar.DataConversion.IXCRMParser>();
            what_can_i_accept_parser.ixcrm_parser = ixcrm_parser;
            IList <string> tag_list = new List <string>();
            IList <Roar.DomainObjects.Modifier> modifier_list   = new List <Roar.DomainObjects.Modifier>();
            IList <Roar.DomainObjects.ItemStat> item_stat_list  = new List <Roar.DomainObjects.ItemStat>();
            IList <Roar.DomainObjects.Modifier> item_price_list = new List <Roar.DomainObjects.Modifier>();
            IList <string> item_tag_list = new List <string>();

            Expect.Once.On(ixcrm_parser).Method("ParseItemStatList").With(nn.SelectSingleNode("./mail/what_can_i_accept/package/item/stats")).Will(Return.Value(item_stat_list));
            Expect.Once.On(ixcrm_parser).Method("ParseModifierList").With(nn.SelectSingleNode("./mail/what_can_i_accept/package/item/price")).Will(Return.Value(item_price_list));
            Expect.Once.On(ixcrm_parser).Method("ParseTagList").With(nn.SelectSingleNode("./mail/what_can_i_accept/package/item/tags")).Will(Return.Value(item_tag_list));

            Expect.Once.On(ixcrm_parser).Method("ParseTagList").With(nn.SelectSingleNode("./mail/what_can_i_accept/package")).Will(Return.Value(tag_list));
            Expect.Once.On(ixcrm_parser).Method("ParseModifierList").With(nn.SelectSingleNode("./mail/what_can_i_accept/package/modifiers")).Will(Return.Value(modifier_list));

            WhatCanIAcceptResponse response = what_can_i_accept_parser.Build(nn);

            mockery.VerifyAllExpectationsHaveBeenMet();

            Assert.AreEqual(response.packages.Count, 1);
            Assert.AreEqual(response.packages[0].id, "15850999291750564699");
            Assert.AreEqual(response.packages[0].type, "item");
            Assert.AreEqual(response.packages[0].sender_id, "123123");
            Assert.AreEqual(response.packages[0].sender_name, "John");
            Assert.AreEqual(response.packages[0].message, "Enjoy the beans!");
            Assert.AreEqual(response.packages[0].items.Count, 1);
            Assert.AreEqual(response.packages[0].tags.Count, 0);
            Assert.AreEqual(response.packages[0].modifiers.Count, 0);
            Assert.AreEqual(response.packages[0].items[0].stats, item_stat_list);
            Assert.AreEqual(response.packages[0].items[0].price, item_price_list);
            Assert.AreEqual(response.packages[0].tags, tag_list);
            Assert.AreEqual(response.packages[0].modifiers, modifier_list);
        }
Пример #8
0
    public void TestNothing()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<nothing/>");
        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as Nothing);
    }
Пример #9
0
    public void TestGrantXP()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<grant_xp value=\"25\"/>");
        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as GrantXp);
        Assert.AreEqual((m as GrantXp).value, 25);
    }
Пример #10
0
        public void TestErrorsOnMissingLabel()
        {
            System.Xml.XmlElement shopElement = RoarExtensions.CreateXmlElement("shop_entry", "");
            shopElement.SetAttribute("ikey", "shop_item_ikey_1");
            shopElement.SetAttribute("description", "Lorem Ipsum");

            Roar.DomainObjects.ShopEntry shopentry = converter.Build(shopElement);

            Assert.AreEqual("", shopentry.label);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Пример #11
0
    public void TestGrantItem()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<grant_item ikey=\"christmas_tree\"/>");

        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as GrantItem);
        Assert.AreEqual((m as GrantItem).ikey, "christmas_tree");
    }
Пример #12
0
        public void TestDeafultOnMissingDescription()
        {
            System.Xml.XmlElement shopElement = RoarExtensions.CreateXmlElement("shop_entry", "");
            shopElement.SetAttribute("ikey", "shop_item_ikey_1");
            shopElement.SetAttribute("label", "Shop item 1");

            Roar.DomainObjects.ShopEntry shopentry = converter.Build(shopElement);

            Assert.AreEqual("", shopentry.description);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Пример #13
0
        public void TestItemsViewXmlParseMechanics()
        {
            string xml =
                @"<roar tick=""135536803344"">
				<items>
					<view status=""ok"">
						<item>
							<stats>
								<regen_stat_limited ikey=""premium_currency"" value=""345"" repeat=""12"" times_used=""4""/>
							</stats>
							<properties>
								<property ikey=""mariner"" value=""543""/>
							</properties>
							<tags>
								<tag value=""magicitem""/>
							</tags>
							<price>
								<grant_item ikey=""talisman""/>
							</price>
						</item>
					</view>
				</items>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);

            Mockery mockery = new Mockery();

            Roar.DataConversion.IXCRMParser    ixcrm_parser   = mockery.NewMock <Roar.DataConversion.IXCRMParser>();
            List <Roar.DomainObjects.ItemStat> item_stat_list = new List <Roar.DomainObjects.ItemStat>();
            List <Roar.DomainObjects.Modifier> modifier_list  = new List <Roar.DomainObjects.Modifier>();
            List <string> tag_list = new List <string>();

            Roar.DataConversion.Responses.Items.View items_view_response_parser = new Roar.DataConversion.Responses.Items.View();
            items_view_response_parser.ixcrm_parser = ixcrm_parser;

            System.Xml.XmlNode stat_node = nn.SelectSingleNode("./items/view/item/stats");
            Expect.Once.On(ixcrm_parser).Method("ParseItemStatList").With(stat_node).Will(Return.Value(item_stat_list));
            System.Xml.XmlNode modifiers_node = nn.SelectSingleNode("./items/view/item/price");
            Expect.Once.On(ixcrm_parser).Method("ParseModifierList").With(modifiers_node).Will(Return.Value(modifier_list));
            System.Xml.XmlNode tag_node = nn.SelectSingleNode("./items/view/item/tags");
            Expect.Once.On(ixcrm_parser).Method("ParseTagList").With(tag_node).Will(Return.Value(tag_list));

            ViewResponse response = items_view_response_parser.Build(nn);

            mockery.VerifyAllExpectationsHaveBeenMet();

            Assert.IsNotNull(response.items);
            Assert.AreEqual(response.items.Count, 1);
            Assert.AreEqual(response.items[0].stats, item_stat_list);
            Assert.AreEqual(response.items[0].price, modifier_list);
            Assert.AreEqual(response.items[0].tags, tag_list);
        }
Пример #14
0
        public void TestWhatCanIAcceptGetXmlAttributes()
        {
            string xml =
                @"<roar tick=""128555554651"">
				<mail>
					<what_can_i_accept status=""ok"">
						<package type=""item"" id=""15850999291750564699"" message=""Enjoy the beans!"" sender_id=""123123"" sender_name=""John"">
							<item id=""15850999291750564699"" ikey=""magic_beans"" count=""1"" label=""Magic Beans"" type=""custom_type"" description=""Grow a beanstalk!"" consumable=""true""/>
						</package>
						<package type=""gift"" id=""6760640600796911244"" message=""Have a happy day"" sender_id=""234"" sender_name=""Brenda"">
							<tag value=""test_tag""/>
							<tag value=""next tag""/>
							<modifiers>
								<grant_item ikey=""item_ikey_1""/>
							</modifiers>
						</package>
					</what_can_i_accept>
				</mail>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Mail.WhatCanIAccept what_can_i_accept_parser = new Roar.DataConversion.Responses.Mail.WhatCanIAccept();
            WhatCanIAcceptResponse response = what_can_i_accept_parser.Build(nn);

            Assert.AreEqual(response.packages.Count, 2);
            Assert.AreEqual(response.packages[0].id, "15850999291750564699");
            Assert.AreEqual(response.packages[0].type, "item");
            Assert.AreEqual(response.packages[0].sender_id, "123123");
            Assert.AreEqual(response.packages[0].sender_name, "John");
            Assert.AreEqual(response.packages[0].message, "Enjoy the beans!");
            Assert.AreEqual(response.packages[0].items.Count, 1);
            Assert.AreEqual(response.packages[0].tags.Count, 0);
            Assert.AreEqual(response.packages[0].items[0].id, "15850999291750564699");
            Assert.AreEqual(response.packages[0].items[0].ikey, "magic_beans");
            Assert.AreEqual(response.packages[0].items[0].count, 1);
            Assert.AreEqual(response.packages[0].items[0].label, "Magic Beans");
            Assert.AreEqual(response.packages[0].items[0].type, "custom_type");
            Assert.AreEqual(response.packages[0].items[0].description, "Grow a beanstalk!");
            Assert.IsTrue(response.packages[0].items[0].consumable);
            Assert.AreEqual(response.packages[0].modifiers.Count, 0);
            Assert.AreEqual(response.packages[1].id, "6760640600796911244");
            Assert.AreEqual(response.packages[1].type, "gift");
            Assert.AreEqual(response.packages[1].sender_id, "234");
            Assert.AreEqual(response.packages[1].sender_name, "Brenda");
            Assert.AreEqual(response.packages[1].message, "Have a happy day");
            Assert.AreEqual(response.packages[1].items.Count, 0);
            Assert.AreEqual(response.packages[1].tags.Count, 2);
            Assert.AreEqual(response.packages[1].modifiers.Count, 1);
            Assert.AreEqual(response.packages[1].tags[0], "test_tag");
            Assert.AreEqual(response.packages[1].tags[1], "next tag");
            Assert.AreEqual((response.packages[1].modifiers[0] as Roar.DomainObjects.Modifiers.GrantItem).ikey, "item_ikey_1");
        }
Пример #15
0
    public void TestRemoveItems()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<remove_items ikey=\"christmas_tree\" count=\"15\"/>");

        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as RemoveItems);
        Assert.AreEqual((m as RemoveItems).ikey, "christmas_tree");
        Assert.AreEqual((m as RemoveItems).count, 15);
    }
Пример #16
0
    public void TestGrantXPRange()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<grant_xp_range min=\"33\" max=\"44\"/>");

        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as GrantXpRange);
        Assert.AreEqual((m as GrantXpRange).min, 33);
        Assert.AreEqual((m as GrantXpRange).max, 44);
    }
Пример #17
0
    public void TestItem()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<item_requirement ikey=\"christmas_tree\" number_required=\"56\" ok=\"false\" reason=\"required christmas_tree(56)\"/>");

        Roar.DomainObjects.Requirements.Item r = parser.ParseARequirement(xmlelement) as Roar.DomainObjects.Requirements.Item;
        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(r);
        Assert.AreEqual(r.ikey, "christmas_tree");
        Assert.AreEqual(r.number_required, 56);
        Assert.AreEqual(r.ok, false);
        Assert.AreEqual(r.reason, "required christmas_tree(56)");
    }
Пример #18
0
    public void TestGrantStat()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<grant_stat type=\"attribute\" ikey=\"_energy_regen_amount\" value=\"5\"/>");

        Modifier m = parser.ParseAModifier(xmlelement);

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(m as GrantStat);
        Assert.AreEqual((m as GrantStat).ikey, "_energy_regen_amount");
        Assert.AreEqual((m as GrantStat).type, "attribute");
        Assert.AreEqual((m as GrantStat).value, 5);
    }
Пример #19
0
    public void TestLevel()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<level_requirement level=\"3\" ok=\"false\" reason=\"requires level 3\"/>");

        Level r = parser.ParseARequirement(xmlelement) as Level;

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(r);
        Assert.AreEqual(r.level, 3);
        Assert.AreEqual(r.ok, false);
        Assert.AreEqual(r.reason, "requires level 3");
    }
Пример #20
0
    public void TestFriends()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement("<friends_requirement required=\"5\" ok=\"false\" reason=\"Insufficient friends\"/>");

        Friends r = parser.ParseARequirement(xmlelement) as Friends;

        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(r);
        Assert.AreEqual(r.required, 5);
        Assert.AreEqual(r.ok, false);
        Assert.AreEqual(r.reason, "Insufficient friends");
    }
Пример #21
0
    public void TestTrue()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement(
            "<true_requirement ok=\"true\" />"
            );

        Roar.DomainObjects.Requirements.True r = parser.ParseARequirement(xmlelement) as Roar.DomainObjects.Requirements.True;
        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(r);
        Assert.AreEqual(r.ok, true);
        Assert.IsNull(r.reason);
    }
Пример #22
0
    public void TestFalse()
    {
        XCRMParser parser = new XCRMParser();

        System.Xml.XmlElement xmlelement = RoarExtensions.CreateXmlElement(
            "<false_requirement ok=\"false\" reason=\"always fails\"/>"
            );

        Roar.DomainObjects.Requirements.False r = parser.ParseARequirement(xmlelement) as Roar.DomainObjects.Requirements.False;
        mockery.VerifyAllExpectationsHaveBeenMet();
        Assert.IsNotNull(r);
        Assert.AreEqual(r.ok, false);
        Assert.AreEqual(r.reason, "always fails");
    }
Пример #23
0
        public void TestUserChangeNameXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""128455461333"">
				<user>
					<change_password status=""ok""/>
				</user>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.User.ChangeName change_name_parser = new Roar.DataConversion.Responses.User.ChangeName();
            ChangeNameResponse response = change_name_parser.Build(nn);

            Assert.IsNotNull(response);
        }
Пример #24
0
        public void TestParseFacebookBindSignedResponse()
        {
            string xml =
                @"<roar tick=""135510457230"">
				<facebook>
					<bind_signed status=""ok""/>
				</facebook>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);

            Roar.WebObjects.Facebook.BindSignedResponse response = (new Roar.DataConversion.Responses.Facebook.BindSigned()).Build(nn);

            Assert.IsNotNull(response);
        }
Пример #25
0
        public void TestUrbanairshipPushXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""128455369786"">
				<urbanairship>
					<ios_register status=""ok"" />
				</urbanairship>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Urbanairship.Push push_parser = new Roar.DataConversion.Responses.Urbanairship.Push();
            PushResponse response = push_parser.Build(nn);

            Assert.IsNotNull(response);
        }
Пример #26
0
        public void TestGoogleBindUserTokenXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""128455369786"">
				<google>
					<bind_user status=""ok""/>
				</google>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Google.BindUserToken bind_user_token_parser = new Roar.DataConversion.Responses.Google.BindUserToken();
            BindUserTokenResponse response = bind_user_token_parser.Build(nn);

            Assert.IsNotNull(response);
        }
Пример #27
0
        public void TestItemsSetXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""128555540202"">
				<items>
					<set status=""ok""/>
				</items>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Items.Set set_parser = new Roar.DataConversion.Responses.Items.Set();
            SetResponse response = set_parser.Build(nn);

            Assert.IsNotNull(response);
        }
Пример #28
0
        public void TestPollInfoXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""135510457230"">
				<info>
					<poll status=""ok""/>
				</info>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);

            PollResponse poll_response = (new Roar.DataConversion.Responses.Info.Poll()).Build(nn);

            Assert.IsNotNull(poll_response);
        }
Пример #29
0
        public void TestAppstoreBuyXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""130695522924"">
				<appstore>
					<buy status=""ok""/>
				</appstore>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.Appstore.Buy buy_parser = new Roar.DataConversion.Responses.Appstore.Buy();
            BuyResponse response = buy_parser.Build(nn);

            Assert.IsNotNull(response);
        }
Пример #30
0
        public void TestUserNetdriveSetXmlGetAttributes()
        {
            string xml =
                @"<roar tick=""135589359998"">
				<user>
					<netdrive_set status=""ok""/>
				</user>
			</roar>"            ;

            System.Xml.XmlElement nn = RoarExtensions.CreateXmlElement(xml);
            Roar.DataConversion.Responses.User.NetdriveSave netdrive_save_parser = new Roar.DataConversion.Responses.User.NetdriveSave();
            NetdriveSaveResponse response = netdrive_save_parser.Build(nn);

            Assert.IsNotNull(response);
        }