Exemplo n.º 1
0
        public void ShouldSetupApplication([Frozen]Mock<IApplicationConfiguration> applicationConfiguration,
			[Frozen]Mock<IAppHarborClient> appharborClient,
			LinkAppCommand command,
			Application application,
			User user)
        {
            appharborClient.Setup(x => x.GetApplication(application.Slug)).Returns(application);
            appharborClient.Setup(x => x.GetUser()).Returns(user);
            applicationConfiguration.Setup(x => x.SetupApplication(application.Slug, user));

            command.Execute(new List<string> { application.Slug }.ToArray());

            applicationConfiguration.Verify(x => x.SetupApplication(application.Slug, user));
        }
		public bool EditApplication(string applicationId, Application application)
		{
			CheckArgumentNull("applicationId", applicationId);
			CheckArgumentNull("application", application);
			CheckArgumentNull("application.Name", application.Name);

			var request = new RestRequest(Method.PUT);
			request.RequestFormat = DataFormat.Json;
			request.Resource = "applications/{applicationId}";
			request.AddParameter("applicationId", applicationId, ParameterType.UrlSegment);
			request.AddBody(new
			{
				name = application.Name,
			});
			return ExecuteEdit(request);
		}