Ejemplo n.º 1
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>());
        }
Ejemplo n.º 2
0
        public void PostUploadGpsTrace_NoFile_ShouldReturnBadRequest()
        {
            var results = _controller.PostUploadGpsTrace(null).Result as BadRequestResult;

            Assert.IsNotNull(results);
        }