public void CtorThrowsIfDependenciesAreNull() { // Act & Assert ExceptionAssert.ThrowsArgNull(() => new PackageManager(null, new DefaultPackagePathResolver("foo"), new MockProjectSystem(), new MockPackageRepository()), "sourceRepository"); ExceptionAssert.ThrowsArgNull(() => new PackageManager(new MockPackageRepository(), null, new MockProjectSystem(), new MockPackageRepository()), "pathResolver"); ExceptionAssert.ThrowsArgNull(() => new PackageManager(new MockPackageRepository(), new DefaultPackagePathResolver("foo"), null, new MockPackageRepository()), "fileSystem"); ExceptionAssert.ThrowsArgNull(() => new PackageManager(new MockPackageRepository(), new DefaultPackagePathResolver("foo"), new MockProjectSystem(), null), "localRepository"); }
public void SetApiKeyThrowsIfSettingsFileIsNull() { // Arrange var packageSourceProvider = new Mock <IPackageSourceProvider>(); // Act and Assert ExceptionAssert.ThrowsArgNull(() => new SetApiKeyCommand(packageSourceProvider.Object, settings: null), "settings"); }
public void EnsureTrailingSlashThrowsIfPathIsNull() { // Arrange string path = null; // Act and Assert ExceptionAssert.ThrowsArgNull(() => PathUtility.EnsureTrailingSlash(path), "path"); }
public void NullThrowsException() { // Arrange string packageId = null; // Act & Assert ExceptionAssert.ThrowsArgNull(() => PackageIdValidator.IsValidPackageId(packageId), "packageId"); }
public void SafeQueryableThrowsIfSourceIsNull() { // Arrange IEnumerable <int> source = null; // Act ExceptionAssert.ThrowsArgNull(() => source.AsSafeQueryable(), "source"); }
public void AddFileThrowsArgumentNullExceptionIfWriteToStreamIsNull() { // Arrange var root = Path.GetRandomFileName(); var target = new PhysicalFileSystem(root); // Act and Assert ExceptionAssert.ThrowsArgNull(() => target.AddFile(Path.GetRandomFileName(), writeToStream: null), "writeToStream"); }
public void SemVerThrowsIfLeftHandExpressionForCompareOperatorsIsNull() { // Arrange SemanticVersion itemA = null; SemanticVersion itemB = new SemanticVersion("1.0"); // Act and Assert ExceptionAssert.ThrowsArgNull(() => { bool val = itemA < itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA <= itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA > itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA >= itemB; }, "version1"); }
public void SemVerThrowsIfLeftHandExpressionForCompareOperatorsIsNull() { // Arrange SemanticVersion itemA = null; SemanticVersion itemB = new SemanticVersion("1.0"); // Disable this warning since it complains on mono #pragma warning disable 0219 // Act and Assert ExceptionAssert.ThrowsArgNull(() => { bool val = itemA < itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA <= itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA > itemB; }, "version1"); ExceptionAssert.ThrowsArgNull(() => { bool val = itemA >= itemB; }, "version1"); #pragma warning restore 0219 }
public void ConstructorThrowsIfSettingsIsNull() { // Act and Assert ExceptionAssert.ThrowsArgNull(() => new SettingsCredentialProvider(credentialProvider: NullCredentialProvider.Instance, packageSourceProvider: null), "packageSourceProvider"); }
public void ConstructorThrowsIfUnderlyingCredentialProviderIsNull() { // Act and Assert ExceptionAssert.ThrowsArgNull(() => new SettingsCredentialProvider(credentialProvider: null, packageSourceProvider: null), "credentialProvider"); }
public void CtorThrowsIfSourceIsNull() { // Act & Assert ExceptionAssert.ThrowsArgNull(() => new BufferedEnumerable <object>(null, 100), "source"); }
public void ParseVersionRangeWithNullThrows() { // Act & Assert ExceptionAssert.ThrowsArgNull(() => VersionRange.Parse(null), "value"); }
public void ConstructorThrowsIfSettingsIsNull() { // Act and Assert ExceptionAssert.ThrowsArgNull(() => new ConfigCommand(settings: null), "settings"); }
public void TrimVersionThrowsIfVersionNull() { ExceptionAssert.ThrowsArgNull(() => VersionUtility.TrimVersion(null), "version"); }
public void ParseVersionSpecWithNullThrows() { // Act & Assert ExceptionAssert.ThrowsArgNull(() => VersionUtility.ParseVersionSpec(null), "value"); }
public void CtorWithStreamThrowsIfNull() { ExceptionAssert.ThrowsArgNull(() => new ZipPackage((Stream)null), "stream"); }
public void CreateRepositoryThrowsIfNullSource() { // Act & Assert ExceptionAssert.ThrowsArgNull(() => new PackageRepositoryFactory().CreateRepository(null), "packageSource"); }
public void SetApiKeyThrowsIfPackageSourceProviderIsNull() { // Act and Assert ExceptionAssert.ThrowsArgNull(() => new SetApiKeyCommand(packageSourceProvider: null, settings: null), "packageSourceProvider"); }