Example #1
0
        public void SamplePublicText_GetValueIsExpected_WhenSet()
        {
            // Arrange
            TemplateClass templateClass = new TemplateClass();
            string        text          = "MyText";

            // Act
            templateClass.SamplePublicText = text;

            //  -----------------------------------------------
            // NOTE: This is a silly demo. It offers low value
            //       to unit test a set/get like this.
            //  -----------------------------------------------

            // Assert
            Assert.AreEqual(templateClass.SamplePublicText, text);
        }
Example #2
0
        public IEnumerator SamplePublicText_GetValueIsExpected_1FrameAfterWhenSet()
        {
            // Arrange
            TemplateClass templateClass = new TemplateClass();
            string        text          = "MyText";

            // Act
            templateClass.SamplePublicText = text;

            //  -----------------------------------------------
            // NOTE: This is a silly demo. There is no reason
            //		 to skip a frame here.
            //  -----------------------------------------------

            // Use yield to skip a frame.
            yield return(null);

            // Assert
            Assert.AreEqual(templateClass.SamplePublicText, text);
        }