mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-19 05:35:11 +00:00
29 lines
754 B
C#
29 lines
754 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Octokit.Reactive;
|
|
|
|
namespace Octokit.Tests.Integration.Helpers
|
|
{
|
|
internal sealed class MaintenanceModeContext : IDisposable
|
|
{
|
|
internal MaintenanceModeContext(IConnection connection, bool enabled)
|
|
{
|
|
_connection = connection;
|
|
|
|
// Ensure maintenance mode is in the desired initial state
|
|
EnterpriseHelper.SetMaintenanceMode(_connection, enabled);
|
|
}
|
|
|
|
private IConnection _connection;
|
|
|
|
public void Dispose()
|
|
{
|
|
// Ensure maintenance mode is OFF
|
|
EnterpriseHelper.SetMaintenanceMode(_connection, false);
|
|
}
|
|
}
|
|
}
|