public async Task GetMachineByIdReturnsUnauthorized()
        {
            _controllerMock.Setup(m => m.GetMachineByIdAsync(It.IsAny <Guid>(), It.IsAny <Guid?>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(new Machine()));

            var validMachineId = Guid.NewGuid();

            var response = await UnauthenticatedBrowser.Get(string.Format(Routing.MachinesWithIdBase, validMachineId), BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async Task GetMachineByKeyReturnsUnauthorized()
        {
            _controllerMock.Setup(m => m.GetMachineByKeyAsync(It.IsAny <string>(), It.IsAny <Guid?>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(new Machine()));

            var validMachineKey = "0123456789";
            var response        = await UnauthenticatedBrowser.Get(Routing.Machines,
                                                                   with =>
            {
                with.HttpRequest();
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.Query("machinekey", validMachineKey);
            });

            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async Task GetProjectLobbyStateAsync_IfNotAuthenticated_ReturnsUnauthorized()
        {
            var response = await UnauthenticatedBrowser.Get($"{Routing.ProjectsRoute}/{Guid.NewGuid()}/{Routing.ProjectLobbyStatePath}", BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
Пример #4
0
        public async void InProductTrainingRespondWithUnauthorizedNoBearer()
        {
            var actual = await UnauthenticatedBrowser.Get($"/v1/inproducttraining/viewed/{_defaultClientApplicationId}", BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, actual.StatusCode);
        }
Пример #5
0
        public async void WizardRespondWithUnauthorizedNoBearer()
        {
            var actual = await UnauthenticatedBrowser.Get($"/v1/wizards/viewed/{_defaultUserId}", BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, actual.StatusCode);
        }
Пример #6
0
        public async Task GetGuestSessionsByProjectIdForUser_WithoutAuthentication_ReturnsUnauthorized()
        {
            var response = await UnauthenticatedBrowser.Get($"{Routing.ProjectsRoute}/{Guid.NewGuid()}/{Routing.UsersPath}/{Guid.NewGuid()}/{Routing.GuestSessionsPath}", BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async void RespondWithUnauthorizedNoBearer()
        {
            var actual = await UnauthenticatedBrowser.Get($"/v1/inProductTraining/{Guid.NewGuid()}", BuildRequest);

            Assert.Equal(HttpStatusCode.Unauthorized, actual.StatusCode);
        }