Beispiel #1
0
        public void TestIsReadonly()
        {
            // Arrange
            Entry <object> entry = new Entry <object>(0, null);

            // Act
            Entry <object> readonlyEntry = entry.AsReadonly();

            // Assert
            Assert.AreEqual(false, entry.IsReadonly);
            Assert.AreEqual(true, readonlyEntry.IsReadonly);
        }
Beispiel #2
0
        public void GetReadonlyColumnIndex()
        {
            // Arrange
            int            columnIndex = 6;
            Entry <string> entry       = new Entry <string>(columnIndex, null);

            // Act
            Entry <string> readonlyEntry = entry.AsReadonly();

            // Assert
            Assert.AreEqual(columnIndex, readonlyEntry.ColumnIndex);
        }
Beispiel #3
0
        public void GetReadonlyContent()
        {
            // Arrange
            string         content = "Test string";
            Entry <string> entry   = new Entry <string>(0, content);

            // Act
            Entry <string> readonlyEntry = entry.AsReadonly();

            // Assert
            Assert.AreSame(content, readonlyEntry.Content);
        }
Beispiel #4
0
        public void SetReadonlyContent()
        {
            // Arrange
            string oldContent    = "Test string",
                   newContent    = "New test string";
            Entry <string> entry = new Entry <string>(0, oldContent);

            // Act
            Entry <string> readonlyEntry = entry.AsReadonly();

            // Asset
            Assert.Catch(
                typeof(InvalidOperationException),
                () =>
            {
                readonlyEntry.Content = newContent;
            });
        }