Commit 58058e74 authored by Michael Adams's avatar Michael Adams

Saw a way to fix the Codacy error

parent 2adc5971
......@@ -3,16 +3,16 @@
using System.Collections.Generic;
using Unosquare.PassCore.Web.Models;
// Codacy kept thinking the original implementation was an issue.
// https://stackoverflow.com/questions/9415257/how-can-i-implement-static-methods-on-an-interface
internal class DebugPasswordChangeProvider : IPasswordChangeProvider
{
public ApiErrorItem PerformPasswordChange(ChangePasswordModel model)
static ApiErrorItem PerformPasswordChange(ChangePasswordModel model)
{
var username = model.Username.Substring(0, model.Username.IndexOf("@"));
switch (username)
{
case "pass":
return null;
case "error":
return new ApiErrorItem { ErrorType = ApiErrorType.GeneralFailure, ErrorCode = ApiErrorCode.Generic, Message = "Error" };
case "notfound":
......@@ -21,5 +21,9 @@
return null;
}
}
ApiErrorItem IPasswordChangeProvider.PerformPasswordChange(ChangePasswordModel model)
{
return DebugPasswordChangeProvider.PerformPasswordChange(model);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment