public void GetPowerBITable_OrganizationScope() { var client = new Mock <IPowerBIApiClient>(); var initFactory = new TestPowerBICmdletInitFactory(client.Object); var cmdlet = new GetPowerBITable(initFactory) { Scope = PowerBIUserScope.Organization, DatasetId = Guid.NewGuid() }; try { // Act cmdlet.InvokePowerBICmdlet(); Assert.Fail("Should not have reached this point"); } catch (System.Reflection.TargetInvocationException ex) { // Assert Assert.AreEqual(ex.InnerException.GetType(), typeof(NotImplementedException)); } }
public void GetPowerBITable_IndividualScope_DatasetIdParameterSetName() { var datasetId = Guid.NewGuid(); var expectedTables = new List <Table> { new Table { Name = "TestTable" } }; var client = new Mock <IPowerBIApiClient>(); client.Setup(x => x.Datasets.GetTables(datasetId, null)).Returns(expectedTables); var initFactory = new TestPowerBICmdletInitFactory(client.Object); var getTableCmdlet = new GetPowerBITable(initFactory) { Scope = PowerBIUserScope.Individual, DatasetId = datasetId }; // Act getTableCmdlet.InvokePowerBICmdlet(); // Assert initFactory.AssertExpectedUnitTestResults(expectedTables); }