示例#1
0
        public void ToImmutable_ImmutableCollection()
        {
            //Arrange
            var source = new ImmutableCollection <char>(new char[] { 'A' });

            //Act
            var immutableCollection = EnumerableExtender.ToImmutable(source);

            //Assert
            Assert.AreEqual('A', immutableCollection[0]);
        }
示例#2
0
        public void ToImmutable_Array()
        {
            //Arrange
            var source = new char[] { 'A' };
            var immutableCollection = EnumerableExtender.ToImmutable(source);

            //Act
            source[0] = 'B';

            //Assert
            Assert.AreEqual('A', immutableCollection[0]);
        }