public StatisticsServiceTests() { mockProjectRepository = new Mock <IProjectRepository>(); mockUserRepository = new Mock <IUserRepository>(); mockTaskRepository = new Mock <ITaskRepository>(); mockPersonInProjectRepository = new Mock <IPersonInProjectRepository>(); mapper = new MapperConfiguration(x => x.AddProfile <MappingProfile>()).CreateMapper(); mockPerson = new Core.Entities.Person { PersonId = Guid.NewGuid(), CreatedDate = DateTime.Now, FirstName = "NewPerson", LastName = "NewPerson", IsActive = true }; mockProject = new Core.Entities.Project { ProjectId = mockProjectId, AuthorId = Guid.NewGuid(), CreatedDate = DateTime.Now, StartDate = DateTime.Now, ConclusionDate = DateTime.Now.AddDays(15), Description = "NewProject", Title = "NewProject" }; }
public PersonViewModel(Core.Entities.Person person) { FirstName = person.FirstName; LastName = person.LastName; EmailAddress = person.EmailAddress; PhoneNumber = person.PhoneNumber; Title = person.Title; }
public static Core.DTOs.Person ToDto(this Core.Entities.Person person, IEnumerable <Core.DTOs.Person> children = null) { return(new Core.DTOs.Person { Id = person.Id, Name = person.Name, Surname = person.Surname, Age = person.Age, Children = children }); }
public UserServiceTests() { mockUserRepo = new Mock <IUserRepository>(); mockPersonRepo = new Mock <IPersonRepository>(); mockPersonService = new Mock <IPersonService>(); mockAuthService = new Mock <IAuthenticationService>(); mapper = new MapperConfiguration(x => x.AddProfile <MappingProfile>()).CreateMapper(); converter = new SynchronizedConverter(new PdfTools()); person = new Core.Entities.Person { PersonId = Guid.NewGuid(), UserId = Guid.NewGuid().ToString(), FirstName = "Test", LastName = "test", CreatedDate = DateTime.Now }; }
public IntegrationTestsBase() { IConfigurationRoot configuration = new ConfigurationBuilder().SetBasePath(AppContext.BaseDirectory) .AddJsonFile("appsettings.json") .Build(); var builder = new DbContextOptionsBuilder <ApplicationDbContext>().UseSqlServer(ConfigurationExtensions.GetConnectionString(configuration, "DefaultConnection")); dbContext = new ApplicationDbContext(builder.Options); dbContext.Database.EnsureDeleted(); dbContext.Database.EnsureCreated(); var user = new ApplicationUser { Id = USER2_USER_ID.ToString(), PasswordHash = "AQAAAAEAACcQAAAAEPMDjNaAOUgXCoM6Pvp++mnypj0VncQAXPxf7F4gi+tirnRyFGidhylYRuMscXJ/QA==", EmailConfirmed = true, Email = "*****@*****.**", NormalizedEmail = "*****@*****.**", UserName = "******", NormalizedUserName = "******" }; dbContext.User.Add(user); var person = new Core.Entities.Person { PersonId = USER2_PERSON_ID, UserId = USER2_USER_ID.ToString(), FirstName = "User2", LastName = "ProjectBoss" }; dbContext.Person.Add(person); mapper = new MapperConfiguration(x => x.AddProfile <MappingProfile>()).CreateMapper(); }
public List <Core.Entities.Task> GetTasks() { Core.Entities.Person author = new Core.Entities.Person { UserId = Guid.NewGuid().ToString(), PersonId = mockAuthorId, FirstName = "NewPerson", LastName = "NewPerson", CreatedDate = DateTime.Now }; Core.Entities.Person attendant = new Core.Entities.Person { UserId = Guid.NewGuid().ToString(), PersonId = mockAttendantId, FirstName = "NewPerson", LastName = "NewPerson", CreatedDate = DateTime.Now }; List <Core.Entities.Task> tasks = new List <Core.Entities.Task>(); tasks.Add(new Core.Entities.Task { TaskId = mockTaskId, Attendant = attendant, Author = author, AuthorId = mockAuthorId, AttendantId = mockAttendantId, ProjectId = mockProjectId, Title = "Title", Description = "Description", StatusId = 1, PriorityId = 2, CreatedDate = DateTime.Now.AddDays(-5), ConclusionDate = DateTime.Now.AddDays(10) }); tasks.Add(new Core.Entities.Task { TaskId = Guid.NewGuid(), Attendant = attendant, AuthorId = Guid.NewGuid(), Author = author, ProjectId = mockProjectId, Title = "Title", Description = "Description", StatusId = 2, PriorityId = 2, CreatedDate = DateTime.Now.AddDays(-5), ConclusionDate = DateTime.Now.AddDays(10), ConcludedDate = DateTime.Now }); tasks.Add(new Core.Entities.Task { TaskId = Guid.NewGuid(), Attendant = attendant, AttendantId = mockAttendantId, Author = author, AuthorId = mockAuthorId, Title = "Title", Description = "Description", StatusId = 1, PriorityId = 2, CreatedDate = DateTime.Now.AddDays(-5), ConclusionDate = DateTime.Now.AddDays(10) }); tasks.Add(new Core.Entities.Task { TaskId = Guid.NewGuid(), Attendant = attendant, AuthorId = Guid.NewGuid(), Author = author, Title = "Title", Description = "Description", StatusId = 1, PriorityId = 2, CreatedDate = DateTime.Now.AddDays(-5), ConclusionDate = DateTime.Now.AddDays(10), ConcludedDate = DateTime.Now, RemovedDate = DateTime.Now, Removed = true }); tasks.Add(new Core.Entities.Task { TaskId = Guid.NewGuid(), Attendant = attendant, AuthorId = Guid.NewGuid(), Author = author, Title = "Title", Description = "Description", StatusId = 1, PriorityId = 2, CreatedDate = DateTime.Now.AddDays(-5), ConclusionDate = DateTime.Now.AddDays(10), RemovedDate = DateTime.Now, Removed = true }); return(tasks); }