示例#1
0
        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>());
        }
示例#4
0
 public GetContactControllerTests() : base("api/contacts")
 {
     Session        = new GetContactSessionMock();
     SessionFactory = new FactorySpy <GetContactSessionMock>(Session);
     Controller     = new GetContactController(SessionFactory.GetInstance);
 }