mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Co-authored-by: Lehonti Ramos <john@doe> Co-authored-by: Keegan Campbell <me@kfcampbell.com>
29 lines
763 B
C#
29 lines
763 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 readonly IConnection _connection;
|
|
|
|
public void Dispose()
|
|
{
|
|
// Ensure maintenance mode is OFF
|
|
EnterpriseHelper.SetMaintenanceMode(_connection, false);
|
|
}
|
|
}
|
|
}
|