예제 #1
0
        public void Items()
        {
            var collection = new[] { "a", "b" };
            var debugView  = new CollectionDebugView<string>(collection);

            Assert.That(debugView.Items, Is.EqualTo(collection));
        }
예제 #2
0
        public void Test_Items()
        {
            var expected = GetRandomArray.OfDoubles(5, 20);

            var sut = new CollectionDebugView<double>(expected);

            Assert.AreEqual(expected, sut.Items, "Arrays should match, but do not.");
        }
예제 #3
0
        public void Test_Constructor_NullParameter()
        {
            object temp = null;

            Assert.Throws<ArgumentNullException>(() => temp = new CollectionDebugView<double>(null));
            var sut = temp as CollectionDebugView<double>;
            Assert.IsNull(sut, "Object should be null.");
        }
예제 #4
0
        public void Test_Constructor_WithParameter()
        {
            var doubles = GetRandomArray.OfDoubles(5, 20);
            object temp = null;

            Assert.DoesNotThrow(()=>temp = new CollectionDebugView<double>(doubles));
            var sut = temp as CollectionDebugView<double>;
            Assert.IsNotNull(sut, "Cannot cast to the expected type.");
        }
 public void ConstructorShouldSetItemsProperty()
 {
     // arrange
     var expected = new List<object>() { new object() };
     var target = new CollectionDebugView<object>( expected );
     
     // act
     var actual = target.Items;
     
     // assert
     Assert.True( actual.SequenceEqual( expected ) );
 }