public BaseContactValidatorTests(ITestOutputHelper output) { var logger = output.CreateLoggerFactory().CreateLogger <ContactValidatorDummy>(); CountryNameValidator = new CountryNameValidatorStub(); Validator = new ContactValidatorDummy(CountryNameValidator, logger); }
public DeleteContactsControllerTests(ITestOutputHelper output) : base("api/contacts/delete") { var loggerFactory = output.CreateLoggerFactory(); Session = new DeleteContactSessionMock(); SessionFactory = new FactorySpy <DeleteContactSessionMock>(Session); Controller = new DeleteContactController(SessionFactory.GetInstance, loggerFactory.CreateLogger <DeleteContactController>()); }
public UpdateContactControllerTests(ITestOutputHelper output) : base("api/contacts/update") { var loggerFactory = output.CreateLoggerFactory(); var validator = new ContactValidator(new CountryNameValidatorStub(), loggerFactory.CreateLogger <ContactValidator>()); Session = new UpdateContactSessionMock(); SessionFactory = new FactorySpy <UpdateContactSessionMock>(Session); Controller = new UpdateContactController(validator, SessionFactory.GetInstance, loggerFactory.CreateLogger <UpdateContactController>()); }
public NewContactControllerTests(ITestOutputHelper output) : base("api/contacts/new") { CountryNameValidator = new CountryNameValidatorStub(); var loggerFactory = output.CreateLoggerFactory(); var validator = new NewContactDtoValidator(CountryNameValidator, loggerFactory.CreateLogger <NewContactDtoValidator>()); Session = new NewContactSessionMock(); SessionFactory = new FactorySpy <NewContactSessionMock>(Session); Mapper = new Mapper(new MapperConfiguration(expression => expression.AddProfile(new NewContactAutoMapperProfile()))); Controller = new NewContactController(validator, SessionFactory.GetInstance, Mapper, loggerFactory.CreateLogger <NewContactController>()); }
public static ILoggerFactory CreateLoggerFactory(ITestOutputHelper output, LoggingSettings settings = null) { EnsureArg.IsNotNull(output, nameof(output)); return(output.CreateLoggerFactory(settings)); }
public ContactValidatorTests(ITestOutputHelper output) { var logger = output.CreateLoggerFactory().CreateLogger <ContactValidator>(); Validator = new ContactValidator(new CountryNameValidatorStub(), logger); }
public static ILogger <T> CreateLogger <T>(this ITestOutputHelper output) { var factory = output.CreateLoggerFactory(); return(factory.CreateLogger <T>()); }