Files
octokit.net/Octokit.Tests.Integration/Helpers/MaintenanceModeContext.cs
Lehonti Ramos d46527d143 Added readonly to fields that are never modified (#2759)
Co-authored-by: Lehonti Ramos <john@doe>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2023-08-11 09:53:51 -07:00

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);
}
}
}