public void TestBuildfileMigratorWithoutBandwith() { ClientContext clientContext = new ClientContext("http://blub"); FileMigrationBuilder builder = FileMigrationBuilder.GetNewFileMigrationBuilder(); builder.WithTargetClientContext(clientContext); builder.WithSourceClientContext(clientContext); builder.WithServiceAddress(new Uri("http://bulub")); SharePoint2010And2013Migrator migrator = builder.CreateMigrator(); Assert.IsNotNull(migrator); Assert.IsTrue(typeof(SharePoint2010And2013Migrator) == migrator.GetType()); }
public void TestBuildfileMigratorWithoutTargetClientContext() { ClientContext clientContext = new ClientContext("http://blub"); FileMigrationBuilder builder = FileMigrationBuilder.GetNewFileMigrationBuilder(); builder.WithSourceClientContext(clientContext); builder.WithBandwith(10); builder.WithServiceAddress(new Uri("http://Address")); try { SharePoint2010And2013Migrator migrator = builder.CreateMigrator(); Assert.Fail("Expected FileMigrationException"); } catch (ValidationException) { // ok } }