示例#1
0
        public void ClearRedisDb_FormsCorrectApplicationRequest_WhenApplicationRunsUnderNetCore()
        {
            IApplicationClient applicationClient = Substitute.For <IApplicationClient>();
            var testUri  = "TestUri";
            var settings = new EnvironmentSettings {
                Uri       = testUri,
                IsNetCore = true
            };
            RedisCommand redisCommand      = new RedisCommand(applicationClient, settings);
            var          clearRedisOptions = Substitute.For <ClearRedisOptions>();

            redisCommand.Execute(clearRedisOptions);
            applicationClient.Received(1).ExecutePostRequest(
                testUri + "/ServiceModel/AppInstallerService.svc/ClearRedisDb",
                "{}", Timeout.Infinite);
        }
示例#2
0
        public void RestartCommand_FormsCorrectApplicationRequest_WhenApplicationRunsUnderNetCoreAndSettingsPickedFromEnvironment()
        {
            IApplicationClient applicationClient = Substitute.For <IApplicationClient>();
            var environmentSettings = new EnvironmentSettings {
                Login      = "******",
                Password   = "******",
                IsNetCore  = true,
                Maintainer = "Test",
                Uri        = "http://test.domain.com"
            };
            RestartCommand restartCommand = new RestartCommand(applicationClient, environmentSettings);
            var            options        = Substitute.For <RestartOptions>();

            restartCommand.Execute(options);
            applicationClient.Received(1).ExecutePostRequest(
                environmentSettings.Uri + "/ServiceModel/AppInstallerService.svc/RestartApp",
                "{}", Timeout.Infinite);
        }
示例#3
0
        public void Delete_FormsCorrectApplicationRequest_WhenApplicationRunsUnderNetFramework()
        {
            IApplicationClient   applicationClient = Substitute.For <IApplicationClient>();
            DeletePackageCommand deleteCommand     = new DeletePackageCommand(applicationClient);
            var deleteOptions = new DeletePkgOptions {
                Login      = "******",
                Password   = "******",
                IsNetCore  = false,
                Maintainer = "Test",
                Uri        = "http://test.domain.com",
                Name       = "TestPackage"
            };

            deleteCommand.Delete(deleteOptions);
            applicationClient.Received(1).ExecutePostRequest(
                deleteOptions.Uri + "/0/ServiceModel/AppInstallerService.svc/DeletePackage",
                "\"TestPackage\"", Arg.Any <int>());
        }