This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CardValidationConfiguration { | |
public CallValidateConfiguration CallValidateConfiguration { get; set; } | |
public int MonthsFromLastPaymentExpiryDateIsValid { get; set;} | |
} | |
public CardValidationService(CardValidationConfiguration config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Microsoft.Practices.ServiceLocation; | |
using Moq; | |
namespace ServiceLocatorMocking | |
{ | |
[TestClass] | |
public class UnitTest1 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Write a test or tests to validate that the correct FubarData is passed to IFubarDataService.Validate(...) | |
from the Fubar that is passed to ValidateFubar. | |
e.g. did the Fubar.Name match the FubarData.Name | |
-- note: imagine there was 15+ properties on both Fubar and FubarData that needed validating | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Vanquis.NewBusiness.Loans.Services.Tests.Utils | |
{ | |
public class ExpectArugmentNullExceptionAttribute : ExpectedExceptionAttribute | |
{ | |
public ExpectArugmentNullExceptionAttribute(string message) | |
: base(typeof(ArgumentNullException)) | |
{ | |
ExpectedMessage = message; | |
MatchType = MessageMatch.Contains; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IMappingExpression<TSource, TDestination> IgnoreAllNonExisting<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression) | |
{ | |
var sourceType = typeof(TSource); | |
var destinationType = typeof(TDestination); | |
var existingMaps = Mapper.GetAllTypeMaps(); | |
var first = existingMaps.First(x => x.SourceType == sourceType && x.DestinationType == destinationType); | |
foreach (var property in first.GetUnmappedPropertyNames()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ProspectBasedUserAuthenticationService | |
2) Injection of dependency IUserAuthenticationService into parameter authenticationService of constructor of type UsersController | |
1) Request for UsersController | |
Suggestions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Vanquis.Services.Communication.Contracts.ServiceContracts | |
{ | |
//Templates | |
public interface ITemplateService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SendTemplate(/* to decide: TemplateId, Parameters */) | |
{ | |
/* | |
- Get any flow with this template (Flow name, Flow Parameters) | |
- Get FlowOrderId of template on Flow | |
- Update Flow parameter values with parameters passed by user | |
- Update special parameters (email, sms) | |
- CreateSchedule | |
- Send Schedule for particular template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ImportSessionContext? | |
public class ImportSession : IImportSession | |
{ | |
private readonly IImportSessionRepository _importSessionRepository; | |
public ImportSession(IImportSessionRepository importSessionRepository) | |
{ | |
_importSessionRepository = importSessionRepository; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task Invoke(HttpContext context) | |
{ | |
var stopWatch = new Stopwatch(); | |
stopWatch.Start(); | |
context.Response.OnStarting(_ => | |
{ | |
((HttpContext)_).Response.Headers["X-Instrumentation-Time-Elapsed-Ms"] = stopWatch.ElapsedMilliseconds.ToString(); | |
return Task.FromResult(0); | |
}, context); |