Skip to content

Instantly share code, notes, and snippets.

public class CardValidationConfiguration {
public CallValidateConfiguration CallValidateConfiguration { get; set; }
public int MonthsFromLastPaymentExpiryDateIsValid { get; set;}
}
public CardValidationService(CardValidationConfiguration config
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Practices.ServiceLocation;
using Moq;
namespace ServiceLocatorMocking
{
[TestClass]
public class UnitTest1
{
/*
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
*/
namespace Vanquis.NewBusiness.Loans.Services.Tests.Utils
{
public class ExpectArugmentNullExceptionAttribute : ExpectedExceptionAttribute
{
public ExpectArugmentNullExceptionAttribute(string message)
: base(typeof(ArgumentNullException))
{
ExpectedMessage = message;
MatchType = MessageMatch.Contains;
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())
{
ProspectBasedUserAuthenticationService
2) Injection of dependency IUserAuthenticationService into parameter authenticationService of constructor of type UsersController
1) Request for UsersController
Suggestions:
@Fodsuk
Fodsuk / gist:5246100
Created March 26, 2013 15:10
Getting better
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Vanquis.Services.Communication.Contracts.ServiceContracts
{
//Templates
public interface ITemplateService
@Fodsuk
Fodsuk / gist:5254318
Created March 27, 2013 13:55
alot to do
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
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);
using FluentValidation;
using FluentValidation.Results;
using Vanquis.Digital.Services.WebAPI.Requests;
using Microsoft.Extensions.Options;
using Vanquis.Digital.Services.WebAPI.Helper;
namespace Vanquis.Digital.Services.WebAPI.ModelValidators
{
public class TransactionRequestValidator : AbstractValidator<TransactionsRequest>
{