示例#1
0
        public void GetTraces_ShouldGetThemFromOsm()
        {
            _controller.SetupIdentity(_cache);
            var osmGateWay = SetupOAuthClient();

            _controller.GetTraces().Wait();

            osmGateWay.Received(1).GetTraces();
        }
        public void GetTraces_ShouldGetThemFromOsm()
        {
            _controller.SetupIdentity();
            var osmGateWay = Substitute.For <IOsmGateway>();

            _httpGatewayFactory.CreateOsmGateway(Arg.Any <TokenAndSecret>()).Returns(osmGateWay);

            _controller.GetTraces().Wait();

            osmGateWay.Received(1).GetTraces();
        }
示例#3
0
        public void PostUploadGpsTrace_UploadFile_ShouldSendItToOsmGateway()
        {
            var file = Substitute.For <IFormFile>();

            file.FileName.Returns("SomeFile.gpx");
            var gateway = Substitute.For <IOsmGateway>();

            _httpGatewayFactory.CreateOsmGateway(Arg.Any <TokenAndSecret>()).Returns(gateway);
            _controller.SetupIdentity();

            _controller.PostUploadGpsTrace(file).Wait();

            gateway.Received(1).CreateTrace(Arg.Any <string>(), Arg.Any <MemoryStream>());
        }