public void Constructor_Enumerable_ShouldMakeCopyOfEndpoints() { // Arrange var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"); var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2"); var endpoints = new List <Endpoint> { endpoint1, endpoint2 }; // Act var dataSource = new DefaultEndpointDataSource((IEnumerable <Endpoint>)endpoints); endpoints.RemoveAt(0); endpoints[0] = null; // Assert Assert.Equal(2, dataSource.Endpoints.Count); Assert.Contains(endpoint1, dataSource.Endpoints); Assert.Contains(endpoint2, dataSource.Endpoints); }