1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05: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,37 +2,38 @@
using Bit.Core.Tokens;
using Xunit;
namespace Bit.Core.Test.Tokens;
public class TokenTests
namespace Bit.Core.Test.Tokens
{
[Theory, AutoData]
public void InitializeWithString_ReturnsString(string initString)
public class TokenTests
{
var token = new Token(initString);
[Theory, AutoData]
public void InitializeWithString_ReturnsString(string initString)
{
var token = new Token(initString);
Assert.Equal(initString, token.ToString());
}
Assert.Equal(initString, token.ToString());
}
[Theory, AutoData]
public void AddsPrefix(Token token, string prefix)
{
Assert.Equal($"{prefix}{token.ToString()}", token.WithPrefix(prefix).ToString());
}
[Theory, AutoData]
public void AddsPrefix(Token token, string prefix)
{
Assert.Equal($"{prefix}{token.ToString()}", token.WithPrefix(prefix).ToString());
}
[Theory, AutoData]
public void RemovePrefix_WithPrefix_RemovesPrefix(string initString, string prefix)
{
var token = new Token(initString).WithPrefix(prefix);
[Theory, AutoData]
public void RemovePrefix_WithPrefix_RemovesPrefix(string initString, string prefix)
{
var token = new Token(initString).WithPrefix(prefix);
Assert.Equal(initString, token.RemovePrefix(prefix).ToString());
}
Assert.Equal(initString, token.RemovePrefix(prefix).ToString());
}
[Theory, AutoData]
public void RemovePrefix_WithoutPrefix_Throws(Token token, string prefix)
{
var exception = Assert.Throws<BadTokenException>(() => token.RemovePrefix(prefix));
[Theory, AutoData]
public void RemovePrefix_WithoutPrefix_Throws(Token token, string prefix)
{
var exception = Assert.Throws<BadTokenException>(() => token.RemovePrefix(prefix));
Assert.Equal($"Expected prefix, {prefix}, was not present.", exception.Message);
Assert.Equal($"Expected prefix, {prefix}, was not present.", exception.Message);
}
}
}