Adds coding standards (#22)

* Adds code requirements

* Update to coding standard
This commit is contained in:
Tim Seaward
2017-11-14 00:45:54 +00:00
committed by Ben Adams
parent fa0ad4ca52
commit 77ba50dff9
8 changed files with 135 additions and 78 deletions

View File

@@ -14,7 +14,7 @@ namespace Demystify
public void ProducesReadableFrames()
{
// Arrange
Exception exception = GetMixedStackException();
var exception = GetMixedStackException();
// Act
var methodNames = new EnhancedStackTrace(exception)
@@ -91,16 +91,10 @@ namespace Demystify
}
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
static async Task<string> MethodAsync<TValue>(TValue value)
{
return await MethodAsync(1);
}
static async Task<string> MethodAsync<TValue>(TValue value) => await MethodAsync(1);
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
static (string val, bool) Method(string value)
{
return (MethodAsync(value).GetAwaiter().GetResult(), true);
}
static (string val, bool) Method(string value) => (MethodAsync(value).GetAwaiter().GetResult(), true);
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
static ref string RefMethod(string value)
@@ -110,10 +104,7 @@ namespace Demystify
}
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
static void Start((string val, bool) param)
{
s_action.Invoke(param.val, param.Item2);
}
static void Start((string val, bool) param) => s_action.Invoke(param.val, param.Item2);
static Action<string, bool> s_action = (string s, bool b) => s_func(s, b);
static Func<string, bool, (string val, bool)> s_func = (string s, bool b) => (RefMethod(s), b);

View File

@@ -24,7 +24,7 @@ namespace Demystify
}
// Act
Exception demystifiedException = new Exception(innerException.Message, innerException).Demystify();
var demystifiedException = new Exception(innerException.Message, innerException).Demystify();
// Assert
var stackTrace = demystifiedException.ToString();