Пример #1
0
        public void RoomBadIdTest()
        {
            XDocument fakeDoc = new XDocument();

            CampfireAPI.API target = new CampfireAPI.API(new MockCampfireToXml(fakeDoc));
            //CampfireAPI.API target = new CampfireAPI.API(Test_CampfireName, Test_AuthToken);
            Room actual = target.GetRoom(9999);

            Assert.IsNull(actual);
        }
Пример #2
0
        public void RoomTest()
        {
            string rawXml = @"
                <room>
                  <created-at >2010-10-14T19:19:37Z</created-at>
                  <id >340141</id>
                  <locked >false</locked>
                  <membership-limit >4</membership-limit>
                  <name>Non-business chatter</name>
                  <topic>A place to discuss non business related topics. Water cooler stuff.</topic>
                  <updated-at >2010-10-14T19:19:37Z</updated-at>
                  <open-to-guests >false</open-to-guests>
                  <full >false</full>
                  <users />
                </room>";

            XDocument fakeDoc = XDocument.Load(new StringReader(rawXml));

            CampfireAPI.API target = new CampfireAPI.API(new MockCampfireToXml(fakeDoc));
            //CampfireAPI.API target = new CampfireAPI.API(Test_CampfireName, Test_AuthToken);
            Room actual = target.GetRoom(340141);

            Assert.AreEqual("Non-business chatter", actual.Name);
        }
Пример #3
0
 public void RoomBadIdTest()
 {
     XDocument fakeDoc = new XDocument();
     CampfireAPI.API target = new CampfireAPI.API(new MockCampfireToXml(fakeDoc));
     //CampfireAPI.API target = new CampfireAPI.API(Test_CampfireName, Test_AuthToken);
     Room actual = target.GetRoom(9999);
     Assert.IsNull(actual);
 }
Пример #4
0
        public void RoomTest()
        {
            string rawXml = @"
                <room>
                  <created-at >2010-10-14T19:19:37Z</created-at>
                  <id >340141</id>
                  <locked >false</locked>
                  <membership-limit >4</membership-limit>
                  <name>Non-business chatter</name>
                  <topic>A place to discuss non business related topics. Water cooler stuff.</topic>
                  <updated-at >2010-10-14T19:19:37Z</updated-at>
                  <open-to-guests >false</open-to-guests>
                  <full >false</full>
                  <users />
                </room>";

            XDocument fakeDoc = XDocument.Load(new StringReader(rawXml));
            CampfireAPI.API target = new CampfireAPI.API(new MockCampfireToXml(fakeDoc));
            //CampfireAPI.API target = new CampfireAPI.API(Test_CampfireName, Test_AuthToken);
            Room actual = target.GetRoom(340141);
            Assert.AreEqual("Non-business chatter", actual.Name);
        }