コード例 #1
0
        public void ToString_BlockIsVisible_ReturnEmptyString()
        {
            // Arrange
            var transHtml = string.Empty;
            var block = new Trans_Template();
            block.Visible = false;

            // Act
            transHtml = block.ToString();

            // Assert
            Assert.IsNullOrEmpty(transHtml);
        }
コード例 #2
0
        public void ToString_WhenCalled_ReturnHtmlString()
        {
            // Arrange
            var transTime = "11/20/2013 6:54:00 AM";
            var transHtml = string.Empty;
            var block = new Trans_Template();
            block.transTime = transTime;

            // Act
            transHtml = block.ToString();

            // Assert
            var expectedHtml = string.Format(TransTemplate, block.TransTime.ToString(), transTime);
            Assert.AreEqual(expectedHtml, transHtml);
        }
コード例 #3
0
        public void ToString_AllChildBlockIsNull_ReturnHtmlStringWithAllChildBlockIsEmpty()
        {
            // Arrange
            var transTime = "11/20/2013 6:54:00 AM";
            var transHtml = string.Empty;
            var block = new Trans_Template();
            block.transTime = transTime;
            block.TransTime = null;

            // Act
            transHtml = block.ToString();

            // Assert
            var expectedHtml = string.Format(TransTemplate, string.Empty, transTime);
            Assert.AreEqual(expectedHtml, transHtml);
        }