public void GetSinksForNetworkTest() { var telemetryDataSinkProcessor = Substitute.For <ITelemetryDataSinkProcessor>(); telemetryDataSinkProcessor.GetSinksForNetwork("2").Returns(c => new List <SinkInfo> { new SinkInfo { SinkName = "currentdata", SinkType = SinkType.CurrentData } }); telemetryDataSinkProcessor.WorkerTelemetryDataSink("currentdata", "2") .Returns(c => new IncomingStubs.CurrentDataStub()); var reportingService = new NetworkReportingService(telemetryDataSinkProcessor, null); var sinks = reportingService.GetSinks("2"); Assert.AreEqual(1, sinks.Count()); Assert.AreEqual("currentdata", sinks.First().SinkName); Assert.AreEqual(SinkType.CurrentData, sinks.First().SinkType); }
public IEnumerable <SinkInfoDto> GetSinks() { var networkId = _networkAuthenticationContext.GetContextNetwork(this.HttpContext); return(_reportingService.GetSinks(networkId)); }