public void DiscoverUnpublishConnectFails() { using (RemoteControllerLogGroup lg = new RemoteControllerLogGroup(remoteWFDController)) { // Publish/Discover string serviceName = remoteWFDController.GenerateUniqueServiceName(); ServicesPublishDiscoverParameters discoverParams = new ServicesPublishDiscoverParameters( serviceName ); var publishDiscoverResults = ExecutePublishDiscoverScenario(discoverParams); // Verify results before we start using them Verify.AreEqual(1, publishDiscoverResults.PublishResults.Count); Verify.AreEqual(1, publishDiscoverResults.DiscoveryResults.Count); Verify.AreEqual(1, publishDiscoverResults.DiscoveryResults[0].DiscoveryHandles.Count); // Unpublish ServicesUnpublishParameters unpublishParams = new ServicesUnpublishParameters( publishDiscoverResults.PublishResults[0].AdvertiserHandle, false ); ExecuteUnpublishScenario(unpublishParams); // Connect (fail) ServicesConnectParameters connectParams = new ServicesConnectParameters( publishDiscoverResults.DiscoveryResults[0].DiscoveryHandles[0], publishDiscoverResults.PublishResults[0].AdvertiserHandle, new ServicesConnectOptions(expectConnectSuccess: false) ); ExecuteConnectScenario(connectParams); } }
public ServicesPublishDiscoverScenario( WiFiDirectTestController discoveryTestController, WiFiDirectTestController advertiserTestController, ServicesPublishDiscoverParameters publishDiscoveryParameters ) { this.discoveryTestController = discoveryTestController; this.advertiserTestController = advertiserTestController; this.publishDiscoveryParameters = publishDiscoveryParameters; }
ServicesPublishDiscoverScenarioResult ExecutePublishDiscoverScenario(ServicesPublishDiscoverParameters pubDiscoParams) { ServicesPublishDiscoverScenario scenario = new ServicesPublishDiscoverScenario( localWFDController, remoteWFDController, pubDiscoParams ); ServicesPublishDiscoverScenarioResult scenarioResult = scenario.Execute(); Verify.IsTrue(scenarioResult.ScenarioSucceeded); return(scenarioResult); }
public void SimpleDiscovery() { using (RemoteControllerLogGroup lg = new RemoteControllerLogGroup(remoteWFDController)) { // Publish one service on remote and discover same from local string serviceName = remoteWFDController.GenerateUniqueServiceName(); var publishDiscoverParams = new ServicesPublishDiscoverParameters( serviceName, discoveryType: ServicesDiscoveryType.FindAllAsync ); ExecutePublishDiscoverScenario(publishDiscoverParams); } }
public void SimpleServiceInfoNoMatchDiscovery() { using (RemoteControllerLogGroup lg = new RemoteControllerLogGroup(remoteWFDController)) { // Publish one service on remote and discover same from local string serviceName = remoteWFDController.GenerateUniqueServiceName(); var publishDiscoverParams = new ServicesPublishDiscoverParameters( serviceName, discoveryType: ServicesDiscoveryType.FindAllAsync, serviceInfo: "<foo>bar</foo>", serviceInfoRequest: "baz", doesServiceInfoMatch: false ); ExecutePublishDiscoverScenario(publishDiscoverParams); } }
/// <summary> /// Simple version for a single publish/discovery/connect of same service /// </summary> public ServicesPublishDiscoverConnectParameters( string serviceName, ServicesConnectOptions connectOptions, bool autoAccept = true, bool preferGO = true, ServicePublishConfigMethods configMethods = ServicePublishConfigMethods.PinOrDefaultDisplay, ServicesDiscoveryType discoveryType = ServicesDiscoveryType.Watcher, string deferredSessionInfo = "" ) { PublishDiscoverParameters = new ServicesPublishDiscoverParameters( new List <ServicesPublishParameters> { new ServicesPublishParameters(serviceName, autoAccept, preferGO, configMethods, sessionInfo: deferredSessionInfo) }, new List <ServicesDiscoveryPrePublishParameters> { new ServicesDiscoveryPrePublishParameters(serviceName, 1, new List <int> { 0 }, discoveryType) } ); ConnectParameters = new List <ServicesConnectPreDiscoveryParameters> { new ServicesConnectPreDiscoveryParameters(0, 0, 0, connectOptions) }; }