1
0
mirror of https://github.com/bitwarden/server synced 2025-12-13 23:03:36 +00:00

Revert filescoped (#2227)

* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2a.
This commit is contained in:
Justin Baur
2022-08-29 15:53:48 -04:00
committed by GitHub
parent 239286737d
commit bae03feffe
1208 changed files with 74317 additions and 73126 deletions

View File

@@ -2,31 +2,32 @@
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Security;
namespace Bit.Test.Common.AutoFixture;
/// <summary>
/// Disables setting of Auto Properties on the Controller to avoid ASP.net initialization errors. Still sets constructor dependencies.
/// </summary>
/// <param name="fixture"></param>
public class ControllerCustomization : ICustomization
namespace Bit.Test.Common.AutoFixture
{
private readonly Type _controllerType;
public ControllerCustomization(Type controllerType)
/// <summary>
/// Disables setting of Auto Properties on the Controller to avoid ASP.net initialization errors. Still sets constructor dependencies.
/// </summary>
/// <param name="fixture"></param>
public class ControllerCustomization : ICustomization
{
if (!controllerType.IsAssignableTo(typeof(Controller)))
private readonly Type _controllerType;
public ControllerCustomization(Type controllerType)
{
throw new InvalidParameterException($"{nameof(controllerType)} must derive from {typeof(Controller).Name}");
if (!controllerType.IsAssignableTo(typeof(Controller)))
{
throw new InvalidParameterException($"{nameof(controllerType)} must derive from {typeof(Controller).Name}");
}
_controllerType = controllerType;
}
_controllerType = controllerType;
public void Customize(IFixture fixture)
{
fixture.Customizations.Add(new BuilderWithoutAutoProperties(_controllerType));
}
}
public void Customize(IFixture fixture)
public class ControllerCustomization<T> : ICustomization where T : Controller
{
fixture.Customizations.Add(new BuilderWithoutAutoProperties(_controllerType));
public void Customize(IFixture fixture) => new ControllerCustomization(typeof(T)).Customize(fixture);
}
}
public class ControllerCustomization<T> : ICustomization where T : Controller
{
public void Customize(IFixture fixture) => new ControllerCustomization(typeof(T)).Customize(fixture);
}