コード例 #1
0
        public void GetAll_ShouldBeEmpty_WhenOrigin_Get_IsNull()
        {
            // Arrange
            _origin.Get().Returns((IEnumerable <int>)null);
            var storage = new CollectionStorage <int>(_origin);

            // Act
            var result = storage.GetAll();

            // Assert
            result.Should().NotBeNull().And.BeEmpty();
        }
コード例 #2
0
        public void GetAll_ShouldBeEquivalentTo_OriginGet()
        {
            // Arrange
            var expected = new[] { 77, 256 };

            _origin.Get().Returns(expected);
            var storage = new CollectionStorage <int>(_origin);

            // Act
            var result = storage.GetAll();

            // Assert
            result.Should().BeEquivalentTo(expected);
        }