Hide.cs 742 B

1234567891011121314151617181920212223242526272829
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using Xunit;
  8. namespace Tests
  9. {
  10. public class Hide : Tests
  11. {
  12. [Fact]
  13. public void Hide_Arguments()
  14. {
  15. AssertThrows<ArgumentNullException>(() => EnumerableEx.Hide<int>(null));
  16. }
  17. [Fact]
  18. public void Hide1()
  19. {
  20. var xs = new List<int> { 1, 2, 3 };
  21. var ys = xs.Hide();
  22. Assert.False(ys is List<int>);
  23. Assert.True(xs.SequenceEqual(ys));
  24. }
  25. }
  26. }