public void Constructor_PackageReaderSource_AllowsNullSource() { using (var packageReader = new TestPackageReader()) using (var result = new DownloadResourceResult(packageReader, source: null)) { Assert.Null(result.PackageSource); } }
public void Constructor_StreamPackageReaderBaseSource_ThrowsForNullStream() { using (var packageReader = new TestPackageReader()) { var exception = Assert.Throws <ArgumentNullException>( () => new DownloadResourceResult(stream: null, packageReader: packageReader, source: "a")); Assert.Equal("stream", exception.ParamName); } }
public void Constructor_PackageReaderSource_InitializesProperties() { using (var packageReader = new TestPackageReader()) using (var result = new DownloadResourceResult(packageReader, source: "a")) { Assert.Same(packageReader, result.PackageReader); Assert.Equal("a", result.PackageSource); Assert.Null(result.PackageStream); Assert.Equal(DownloadResourceResultStatus.AvailableWithoutStream, result.Status); } }
public void Constructor_StreamPackageReaderBase_InitializesProperties() { using (var packageReader = new TestPackageReader()) using (var result = new DownloadResourceResult(Stream.Null, packageReader, source: null)) { Assert.Same(packageReader, result.PackageReader); Assert.Null(result.PackageSource); Assert.Same(Stream.Null, result.PackageStream); Assert.Equal(DownloadResourceResultStatus.Available, result.Status); } }