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 commit239286737d
. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a
.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user