예제 #1
0
        public void When_I_Call_GetBuildStatus_And_There_Is_Data_The_Status_Will_Be_CorectlyRead()
        {
            var    testDocument = new XmlDocument();
            string xmlStatus    = "SUCCESS";

            testDocument.LoadXml(string.Format("<body status='{0}'></body>", xmlStatus));
            _teamCityService.LoadXmlFromUrl(Arg.Any <string>()).ReturnsForAnyArgs(testDocument);

            //Act
            var status = _teamCityService.GetBuildStatus("123");

            //Assert
            Assert.AreEqual(xmlStatus, status);
        }
예제 #2
0
 public void Arrange()
 {
     _teamCityService = Substitute.For <TeamCityService>();
     _teamCityService.LoadXmlFromUrl(Arg.Any <string>()).ReturnsForAnyArgs(new XmlDocument());
 }