1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

Run formatting (#2230)

This commit is contained in:
Justin Baur
2022-08-29 16:06:55 -04:00
committed by GitHub
parent 9b7aef0763
commit 7f5f010e1e
1205 changed files with 73813 additions and 75022 deletions

View File

@ -2,38 +2,37 @@
using Bit.Core.Tokens;
using Xunit;
namespace Bit.Core.Test.Tokens
namespace Bit.Core.Test.Tokens;
public class TokenTests
{
public class TokenTests
[Theory, AutoData]
public void InitializeWithString_ReturnsString(string initString)
{
[Theory, AutoData]
public void InitializeWithString_ReturnsString(string initString)
{
var token = new Token(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);
}
}