public void EFRepository_AddNote_ValidCall() { List <Note> listOfNotes = CreateTestData.GetListOfNotes(); var mockSet = new Mock <DbSet <Note> >() .SetupData(listOfNotes, o => { return(listOfNotes.Single(x => x.Note_id.CompareTo(o.First()) == 0)); }); using (var mockContext = AutoMock.GetLoose()) { var expected = CreateTestData.GetSampleNote(); var id = Guid.Parse("b346eee6-eba7-4ea7-be2e-911bb9034233"); expected.Note_id = id; mockContext.Mock <CharacterContext>() .Setup(x => x.Set <Note>()).Returns(mockSet.Object); //Act INotesRepository toTest = mockContext.Create <NotesRepository>(); toTest.Add(expected); var actual = toTest.Get(id); //Assert actual.Should().NotBeNull(); expected.Should().NotBeNull(); actual.Should().BeOfType <Note>(); expected.Should().BeOfType <Note>(); actual.Should().BeEquivalentTo(expected); } }
public NotesControllerTest(NotesController controller, INotesService service, AuthenticationContext authenticationContext, INotesRepository repository) { this.controller = controller; this.service = service; this.repository = repository; this.authenticationContext = new Mock <AuthenticationContext>(); }
public NotesService(INotesRepository notesRepository, IConfiguration configuration, IHostingEnvironment hostingEnvironment, ILogger <NotesService> logger) { _notesRepository = notesRepository; _configuration = configuration; _hostingEnvironment = hostingEnvironment; _logger = logger; }
public void EFRepository__GetNote_ValidCall() { //Arrange List <Note> listOfNotes = CreateTestData.GetListOfNotes(); var mockSet = new Mock <DbSet <Note> >() .SetupData(listOfNotes, o => { return(listOfNotes.Single(x => x.Note_id.CompareTo(o.First()) == 0)); }); using (var mockContext = AutoMock.GetLoose()) { var expected = CreateTestData.GetSampleNote(); mockContext.Mock <CharacterContext>() .Setup(x => x.Set <Note>()).Returns(mockSet.Object); //Act INotesRepository toTest = mockContext.Create <NotesRepository>(); var actual = toTest.Get(expected.Note_id); //Assert actual.Should().NotBeNull(); expected.Should().NotBeNull(); actual.Should().BeOfType <Note>(); expected.Should().BeOfType <Note>(); actual.Should().BeEquivalentTo(expected); } }
public NotesController(INotesRepository iNotesRepository) { _iNotesRepository = iNotesRepository; NotesRepository notesRepository = new NotesRepository(); notesRepository.OpenFile("CollectionOfNotes\\NoteRepository.json"); }
public NotesController(INotesRepository notesRepository, IMapper mapper, UserManager <NotesUser> userManager) { _notesRepository = notesRepository; _mapper = mapper; _userManager = userManager; }
public OutboundCallQueueService(ICallQueueCustomerRepository callQueueCustomerRepository, ICustomerRepository customerRepository, IProspectCustomerRepository prospectCustomerRepository, ICallQueueCustomerCallRepository callQueueCustomerCallRepository, ICallCenterCallRepository callCenterCallRepository, ICallCenterNotesRepository callCenterNotesRepository, IOutboundCallQueueListModelFactory outboundCallQueueListModelFactory, INotesRepository notesRepository, ICallQueueCriteriaRepository callQueueCriteriaRepository, ICriteriaRepository criteriaRepository, ICustomerCallNotesRepository customerCallNotesRepository, IOrganizationRoleUserRepository organizationRoleUserRepository, ISettings settings, IEventRepository eventRepository, IHostRepository hostRepository, IPodRepository podRepository, IEventCustomerRepository eventCustomerRepository, IAppointmentRepository appointmentRepository, IRoleRepository roleRepository, IRefundRequestRepository refundRequestRepository, IOrderRepository orderRepository, IDirectMailRepository directMailRepository, IDirectMailTypeRepository directMailTypeRepository) { _callQueueCustomerRepository = callQueueCustomerRepository; _customerRepository = customerRepository; _prospectCustomerRepository = prospectCustomerRepository; _callQueueCustomerCallRepository = callQueueCustomerCallRepository; _callCenterCallRepository = callCenterCallRepository; _callCenterNotesRepository = callCenterNotesRepository; _outboundCallQueueListModelFactory = outboundCallQueueListModelFactory; _notesRepository = notesRepository; _callQueueCriteriaRepository = callQueueCriteriaRepository; _criteriaRepository = criteriaRepository; _customerCallNotesRepository = customerCallNotesRepository; _organizationRoleUserRepository = organizationRoleUserRepository; _settings = settings; _eventRepository = eventRepository; _hostRepository = hostRepository; _podRepository = podRepository; _eventCustomerRepository = eventCustomerRepository; _appointmentRepository = appointmentRepository; _roleRepository = roleRepository; _refundRequestRepository = refundRequestRepository; _orderRepository = orderRepository; _directMailRepository = directMailRepository; _directMailTypeRepository = directMailTypeRepository; }
public CustomerEventPriorityInQueueDataRepository(IPriorityInQueueRepository priorityInQueueRepository, IEventCustomerResultRepository eventCustomerResultRepository, INotesRepository notesRepository, ISettings settings) { _priorityInQueueRepository = priorityInQueueRepository; _eventCustomerResultRepository = eventCustomerResultRepository; _notesRepository = notesRepository; _settings = settings; }
public void EFRepository__DeleteNote_ValidCall() { //Arrange List <Note> listOfNotes = CreateTestData.GetListOfNotes(); var mockSet = new Mock <DbSet <Note> >() .SetupData(listOfNotes, o => { return(listOfNotes.Single(x => x.Note_id.CompareTo(o.First()) == 0)); }); using (var mockContext = AutoMock.GetLoose()) { var ToBeDeleted = CreateTestData.GetSampleNote(); mockContext.Mock <CharacterContext>() .Setup(x => x.Set <Note>()).Returns(mockSet.Object); //Act INotesRepository toTest = mockContext.Create <NotesRepository>(); toTest.Remove(ToBeDeleted.Note_id); //Assert listOfNotes.Should().NotBeEmpty(); listOfNotes.Should().NotContain(ToBeDeleted); listOfNotes.Should().BeOfType <List <Note> >(); } }
public LabelService(ILabelRepository repository , IMapper mapper , INotesRepository notesRepository) { _repository = repository; _mapper = mapper; _notesRepository = notesRepository; }
public NotesController(IUrlLocationHelper locationHelper, ICreationService creationService, IUpdateService updateService, INotesRepository notesRepository, IRetrievalService retrievalService) { _locationHelper = locationHelper; _creationService = creationService; _updateService = updateService; _notesRepository = notesRepository; _retrievalService = retrievalService; }
public NotesController( INotesService noteService, INotesRepository noteRepository, ICustomerRepository customerRepository) { this.noteService = noteService; this.noteRepository = noteRepository; this.customerRepository = customerRepository; }
public NotesPresenter(INotesView view, INotesRepository repository, ISecurityManager securityManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(repository, "repository"); ArgumentChecker.ThrowIfNull(securityManager, "securityManager"); this.view = view; this.repository = repository; this.securityManager = securityManager; }
public NoteController(INotesRepository notesRepository) { if (notesRepository == null) { string exceptionMessage = ExceptionMessage.NullNotesRepository; throw new ArgumentNullException(exceptionMessage); } this.notesRepository = notesRepository; }
public CollaboratorService(INotesRepository noteRepository , ICollaboratorRepository collaboratorRepository , IMapper mapper , IMqServices mqServices) { _noteRepository = noteRepository; _collaboratorRepository = collaboratorRepository; _mapper = mapper; _mqServices = mqServices; }
public NotesManager(IUserManager userManager, ICacheStoreManager cacheStoreManager, ILogManager logManager, INotesRepository dealNotesRepository, INotesTransformationManager notesTransformationManager, ITbDealNotesRepository tbDealNotesRepository) : base(userManager, cacheStoreManager, logManager) { _notesRepository = ValidateRepository(dealNotesRepository); _notesTransformationManager = ValidateManager(notesTransformationManager); _tbDealNotesRepository = ValidateRepository(tbDealNotesRepository); }
public OrganizerController(UserManager <UserModel> userManager, IChatRepository chatRepository, INotesRepository notesRepository, RoleManager <IdentityRole> roleManager, IInboxRepository inboxRepository) { _userManager = userManager; _chatRepository = chatRepository; _notesRepository = notesRepository; _roleManager = roleManager; _inboxRepository = inboxRepository; }
private void LoadData() { var notes = _persistenceManager.LoadAllNotes(); NotesRepository = new LocalNotesRepository( notes.Where(n => !n.Deleted).ToList(), notes.Where(n => n.Deleted).ToList()); foreach (var loadedNote in NotesRepository.GetAll()) { NotesTree.Items.Add(new NoteTreeItem(this, loadedNote.Id)); } }
public CustomerNotesAdderPresenter(ICustomerNotesAdderView view, IDictionaryRepository dictionaryRepository, INotesRepository notesRepository, ICustomerRepository customerRepository, ISecurityManager securityManager) { ArgumentChecker.ThrowIfNull(view, "view"); ArgumentChecker.ThrowIfNull(dictionaryRepository, "dictionaryRepository"); ArgumentChecker.ThrowIfNull(notesRepository, "notesRepository"); ArgumentChecker.ThrowIfNull(customerRepository, "customerRepository"); ArgumentChecker.ThrowIfNull(securityManager, "securityManager"); this.view = view; this.notesRepository = notesRepository; this.customerRepository = customerRepository; this.securityManager = securityManager; }
//TODO:: a possible resason for not synching is that here a date is saved in utc and in web client in gmt + 3 format protected override void OnCreate(Bundle bundle) { chosenNotebookId = Guid.Parse(Intent.GetStringExtra("notebookId")); RequestWindowFeature(WindowFeatures.ActionBar); ActionBar.SetHomeButtonEnabled(true); base.OnCreate(bundle); // Create your application here SetContentView(Resource.Layout.NoteDetails); _txtNote = FindViewById<EditText>(Resource.Id.txtNote); _txtContent = FindViewById<EditText>(Resource.Id.txtContent); Button deleteButton = FindViewById<Button>(Resource.Id.deleteNoteButton); Button addEditButton = FindViewById<Button>(Resource.Id.addEditButton); _notesRepository = Kernel.Get<INotesRepository>(); if (Intent.GetStringExtra("action").Equals("ADD")) { addEditButton.Click += AddButton_Click; deleteButton.Visibility = ViewStates.Invisible; } else//EDIT { string jsonNote = Intent.GetStringExtra("note"); if (jsonNote == null) { throw new Exception("Note to be edited was not passed"); } _noteToBeEdited = ObjectConverter.ToObject<Note>(jsonNote); _txtNote.Text = _noteToBeEdited.Name; _txtContent.Text = _noteToBeEdited.Content; addEditButton.Text = "Save Changes"; addEditButton.Click += EditButton_Click; } deleteButton.Click += DeleteButton_Click; }
public void EFRepository_GetNotesOwnedByCharacter_ValidCall() { //Arrange List <Note> listOfNotes = CreateTestData.GetListOfNotes(); var mockSet = new Mock <DbSet <Note> >() .SetupData(listOfNotes, o => { return(listOfNotes.Single(x => x.Note_id.CompareTo(o.First()) == 0)); }); using (var mockContext = AutoMock.GetLoose()) { var expected = new List <Note>(); expected.Add(CreateTestData.GetSampleNote()); var GreatAxe = new Note() { Note_id = Guid.Parse("361bd911-0702-437f-ab59-a29da0f9fba4"), Character_id = Guid.Parse("11111111-2222-3333-4444-555555555555"), Name = "How To Use a Great Axe Ft. Grog Strongjaw", Contents = "Lorem Ipsum" }; expected.Add(GreatAxe); //1. When the mockContext.Mock <CharacterContext>() .Setup(x => x.Set <Note>()).Returns(mockSet.Object); //Act INotesRepository toTest = mockContext.Create <NotesRepository>(); var actual = toTest.GetNotesOwnedBy(Guid.Parse("11111111-2222-3333-4444-555555555555")); actual.Should().NotBeEmpty(); expected.Should().NotBeEmpty(); actual.Should().NotBeNull(); expected.Should().NotBeNull(); actual.Should().BeOfType <List <Note> >(); expected.Should().BeOfType <List <Note> >(); actual.Should().BeEquivalentTo(expected); } }
/// <summary> /// Initializes a new instance of the <see cref="MainForm"/> class. /// </summary> /// <param name="colorParser">Color Parser.</param> /// <param name="textEncryptor">Text Encryptor.</param> /// <param name="notesRepository">Notes Repository.</param> public MainForm(IColorParser colorParser, ITextEncryptor textEncryptor, INotesRepository notesRepository) { this.InitializeComponent(); // Services this.colorParser = colorParser; this.textEncryptor = textEncryptor; this.notesRepository = notesRepository; // Create fonts var fontFamily = this.mainView.Font.FontFamily; this.header1Font = new Font(fontFamily, 16.0f, FontStyle.Bold); this.header2Font = new Font(fontFamily, 14.0f, FontStyle.Bold); this.header3Font = new Font(fontFamily, 13.0f, FontStyle.Bold); this.listFont = new Font(fontFamily, 12.0f, FontStyle.Bold); this.normalFont = this.mainView.Font; // No password yet this.password = null; }
public CallOutcomeService(IUniqueItemRepository <CustomerCallNotes> customerCallNotesRepository, ICallCenterCallRepository callCenterCallRepository, ICallQueueCustomerRepository callQueueCustomerRepository, ICallCenterNotesRepository callCenterNotesRepository, IProspectCustomerRepository prospectCustomerRepository , ICustomerRepository customerRepository, IEventRepository eventRepository, IProspectCustomerFactory prospectCustomerFactory, ICustomerService customerService, ICallQueueCustomerContactService callQueueCustomerContactService, ICustomerCallQueueCallAttemptRepository customerCallQueueCallAttemptRepository, ICallQueueRepository callQueueRepository, INotesRepository notesRepository, ILogManager logManager) { _customerCallNotesRepository = customerCallNotesRepository; _callCenterCallRepository = callCenterCallRepository; _callQueueCustomerRepository = callQueueCustomerRepository; _callCenterNotesRepository = callCenterNotesRepository; _prospectCustomerRepository = prospectCustomerRepository; _customerRepository = customerRepository; _eventRepository = eventRepository; _prospectCustomerFactory = prospectCustomerFactory; _customerService = customerService; _callQueueCustomerContactService = callQueueCustomerContactService; _customerCallQueueCallAttemptRepository = customerCallQueueCallAttemptRepository; _callQueueRepository = callQueueRepository; _notesRepository = notesRepository; _logger = logManager.GetLogger("CallOutcomeService"); }
public HospitalPartnerService(IEventCustomerRepository eventCustomerRepository, ICustomerRepository customerRepository, IOrderRepository orderRepository, IEventPackageRepository eventPackageRepository, IEventTestRepository eventTestRepository, IHospitalPartnerCustomerViewModelFactory hospitalPartnerCustomerViewModelFactory, IEventCustomerResultRepository eventCustomerResultRepository, IHospitalPartnerRepository hospitalPartnerRepository, IHospitalPartnerCustomerRepository hospitalPartnerCustomerRepository, IOrganizationRoleUserRepository organizationRoleUserRepository, IEventRepository eventRepository, IPodRepository podRepository, IOrganizationRepository organizationRepository, IHostRepository hostRepository, IHospitalPartnerEventListFactory hospitalPartnerEventListFactory, IUniqueItemRepository <ShippingDetail> shippingDetailRepository, IShippingOptionRepository shippingOptionRepository, ICorporateAccountRepository corporateAccountRepository, INotesRepository notesRepository, IPrimaryCarePhysicianRepository primaryCarePhysicianRepository, IHealthAssessmentRepository healthAssessmentRepository, IHospitalPartnerDashboardViewModelFactory hospitalPartnerViewModelFactory, ICustomerCallNotesRepository customerCallNotesRepository, IEventCustomerNotificationRepository eventCustomerNotificationRepository, IHospitalFacilityRepository hospitalFacilityRepository, ISettings settings, ILanguageRepository languageRepository) { _eventCustomerRepository = eventCustomerRepository; _customerRepository = customerRepository; _orderRepository = orderRepository; _eventPackageRepository = eventPackageRepository; _eventTestRepository = eventTestRepository; _hospitalPartnerCustomerViewModelFactory = hospitalPartnerCustomerViewModelFactory; _eventCustomerResultRepository = eventCustomerResultRepository; _hospitalPartnerCustomerRepository = hospitalPartnerCustomerRepository; _organizationRoleUserRepository = organizationRoleUserRepository; _eventRepository = eventRepository; _hostRepository = hostRepository; _hospitalPartnerEventListFactory = hospitalPartnerEventListFactory; _shippingDetailRepository = shippingDetailRepository; _shippingOptionRepository = shippingOptionRepository; _podRepository = podRepository; _hospitalPartnerRepository = hospitalPartnerRepository; _organizationRepository = organizationRepository; _corporateAccountRepository = corporateAccountRepository; _notesRepository = notesRepository; _primaryCarePhysicianRepository = primaryCarePhysicianRepository; _healthAssessmentRepository = healthAssessmentRepository; _hospitalPartnerViewModelFactory = hospitalPartnerViewModelFactory; _customerCallNotesRepository = customerCallNotesRepository; _eventCustomerNotificationRepository = eventCustomerNotificationRepository; _hospitalFacilityRepository = hospitalFacilityRepository; _settings = settings; _languageRepository = languageRepository; }
public Operations(INotesRepository repository) { this._repository = repository; }
public NotesService(INotesMetadataService notesMetadataService, INotesRepository notesRepository) { _notesMetadataService = notesMetadataService; _notesRepository = notesRepository; }
public NotesBusiness(INotesRepository notesRepository) { _notesRepository = notesRepository; }
public void SetUp() { _mockedNotesRepository = MockNotesRepository(); _retrievalService = new RetrievalService(_mockedNotesRepository); }
public NoteController(INotesRepository notesRepository, IMapper mapper) { _notesRepository = notesRepository; _mapper = mapper; }
public NotesService(INotesRepository notesRepository) { _notesRepository = notesRepository; }
public NotesController(INotesRepository notesRepository) { _notesRepository = notesRepository; notesRepository.SetPath("NotesStorage\\notes.txt"); }
public void SetUp() { _nHibernateHelper = new TestNHibernateHelper(); _notesRepository = new NotesRepository(_nHibernateHelper); }
public TaskListsService(IUnitOfWork unitOfWork, ITaskListsRepository taskListsRepository, INotesRepository notesRepository) { _unitOfWork = unitOfWork; _taskListsRepository = taskListsRepository; _notesRepository = notesRepository; }
public DataManager(INotesRepository notes) { Notes = notes; }
public NotesService(IUnitOfWork unitOfWork, INotesRepository notesRepository, ITaskListsService taskListsService) { _unitOfWork = unitOfWork; _repository = notesRepository; _taskListsService = taskListsService; }