Example #1
0
        public void CheckSaveStatus_Called_SqlDisposed()
        {
            // Arrange
            SetupShims();

            // Act
            var message = TimesheetAPI.CheckSaveStatus(XmlSample, _sharepointShims.WebShim);

            // Assert
            Assert.AreEqual(
                "<SaveStatus Result=\"0\" Status=\"5\" PercentComplete=\"7\" ErrorResult=\"result-sample\"" +
                " ResultText=\"result-text-sample\"></SaveStatus>",
                message);
            Assert.IsTrue(_adoShims.ConnectionsDisposed.Any());
            Assert.AreEqual(1, _adoShims.CommandsDisposed.Count);
            Assert.AreEqual(1, _adoShims.DataReadersDisposed.Count);
        }