Ejemplo n.º 1
0
        static DataFiles()
        {
            var customers = $"TestData{ Slash }Customers.json";
            var orders    = $"TestData{ Slash }Orders.json";
            var items     = $"TestData{ Slash }Items.json";

            // Services
            DataFileNames.Add(typeof(Customer), customers);
            DataFileNames.Add(typeof(CustomerRequest), customers);

            DataFileNames.Add(typeof(Order), orders);
            DataFileNames.Add(typeof(CreateOrderRequest), orders);
            DataFileNames.Add(typeof(UpdateOrderRequest), orders);

            DataFileNames.Add(typeof(OrderItem), items);
            DataFileNames.Add(typeof(CreateOrderItemRequest), items);
            DataFileNames.Add(typeof(UpdateOrderItemRequest), items);

            // Controllers
            DataFileNames.Add(typeof(ApiCustomerRequest), customers);

            DataFileNames.Add(typeof(ApiCreateOrderRequest), orders);
            DataFileNames.Add(typeof(ApiUpdateOrderRequest), orders);

            DataFileNames.Add(typeof(ApiCreateOrderItemRequest), items);
            DataFileNames.Add(typeof(ApiUpdateOrderItemRequest), items);
        }
Ejemplo n.º 2
0
        public Fakes()
        {
            DataFileNames.Add(typeof(User), $"TestData{Path.DirectorySeparatorChar}users.json");
            DataFileNames.Add(typeof(UserDTO), $"TestData{Path.DirectorySeparatorChar}users.json");
            DataFileNames.Add(typeof(Company), $"TestData{Path.DirectorySeparatorChar}companies.json");
            DataFileNames.Add(typeof(CompanyDTO), $"TestData{Path.DirectorySeparatorChar}companies.json");
            DataFileNames.Add(typeof(Models.Challenge), $"TestData{Path.DirectorySeparatorChar}companies.json");
            DataFileNames.Add(typeof(ChallengeDTO), $"TestData{Path.DirectorySeparatorChar}companies.json");
            DataFileNames.Add(typeof(Acceleration), $"TestData{Path.DirectorySeparatorChar}accelerations.json");
            DataFileNames.Add(typeof(AccelerationDTO), $"TestData{Path.DirectorySeparatorChar}accelerations.json");
            DataFileNames.Add(typeof(Submission), $"TestData{Path.DirectorySeparatorChar}submissions.json");
            DataFileNames.Add(typeof(SubmissionDTO), $"TestData{Path.DirectorySeparatorChar}submissions.json");
            DataFileNames.Add(typeof(Candidate), $"TestData{Path.DirectorySeparatorChar}candidates.json");
            DataFileNames.Add(typeof(CandidateDTO), $"TestData{Path.DirectorySeparatorChar}candidates.json");

            var configuration = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <User, UserDTO>().ReverseMap();
                cfg.CreateMap <Company, CompanyDTO>().ReverseMap();
                cfg.CreateMap <Models.Challenge, ChallengeDTO>().ReverseMap();
                cfg.CreateMap <Acceleration, AccelerationDTO>().ReverseMap();
                cfg.CreateMap <Submission, SubmissionDTO>().ReverseMap();
                cfg.CreateMap <Candidate, CandidateDTO>().ReverseMap();
            });

            this.Mapper = configuration.CreateMapper();
        }
        public FakeContext()
        {
            DataFileNames.Add(typeof(Log), $"TestData{Path.DirectorySeparatorChar}log.json");
            DataFileNames.Add(typeof(LogDTO), $"TestData{Path.DirectorySeparatorChar}log.json");
            DataFileNames.Add(typeof(LogAddDTO), $"TestData{Path.DirectorySeparatorChar}log.json");
            DataFileNames.Add(typeof(LogUpdateDTO), $"TestData{Path.DirectorySeparatorChar}log.json");
            DataFileNames.Add(typeof(Organization), $"..\\..\\TestData{Path.DirectorySeparatorChar}organization.json");
            DataFileNames.Add(typeof(OrganizationDTO), $"..\\..\\..\\TestData{Path.DirectorySeparatorChar}organization.json");
            DataFileNames.Add(typeof(OrganizationAddDTO), $"..\\..\\..\\TestData{Path.DirectorySeparatorChar}organization.json");

            var configuration = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <Log, LogDTO>().ReverseMap();
                cfg.CreateMap <Organization, OrganizationDTO>().ReverseMap();

                cfg.CreateMap <Log, LogAddDTO>().ReverseMap();
                cfg.CreateMap <Organization, OrganizationAddDTO>().ReverseMap();

                cfg.CreateMap <Log, LogUpdateDTO>().ReverseMap();

                cfg.CreateMap <IdentityUser, UserDTO>().ReverseMap();

                cfg.CreateMap <IdentityUser, UserIdDTO>().ReverseMap();
            });

            this.Mapper = configuration.CreateMapper();
        }
        public Fakes()
        {
            DataFileNames.Add(typeof(ErrorLogData), $"C:\\Users\\devso\\ProjetoFinal\\AwesomePotatoTests\\TestData{Path.DirectorySeparatorChar}errorLogData.json");

            var configuration = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <ErrorLogData, ErrorLogDataDTO>().ReverseMap();
            });

            this.Mapper = configuration.CreateMapper();
        }
Ejemplo n.º 5
0
        public FakeContext(string testName)
        {
           
            FakeOptions = new DbContextOptionsBuilder<MainContext>()
                .UseInMemoryDatabase($"Sales_{testName}")
                .Options;

            var path = @$"{AppDomain.CurrentDomain.BaseDirectory.Split(@"\bin")[0]}\FakeData\";

            DataFileNames.Add(typeof(Product), $"{path}products.json");
            DataFileNames.Add(typeof(Sale), $"{path}sales.json");
        }
Ejemplo n.º 6
0
        public FakeContext(string testName)
        {
            FakeOptions = new DbContextOptionsBuilder<MainContext>()
                .UseInMemoryDatabase($"ErrorCentral_{testName}")
                .Options;

            var path = @$"{AppDomain.CurrentDomain.BaseDirectory.Split(@"\bin")[0]}\FakeData\";

            DataFileNames.Add(typeof(User), $"{path}users.json");
            DataFileNames.Add(typeof(Layer), $"{path}layers.json");
            DataFileNames.Add(typeof(Level), $"{path}levels.json");
            DataFileNames.Add(typeof(Status), $"{path}status.json");
            DataFileNames.Add(typeof(Environment), $"{path}environments.json");
            DataFileNames.Add(typeof(Log), $"{path}logs.json");
        }
Ejemplo n.º 7
0
        public FakeContext()
        {
            FakeOptions = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;

            DataFileNames.Add(typeof(UserModel), $"FakeData{Path.DirectorySeparatorChar}users.json");
            DataFileNames.Add(typeof(LevelModel), $"FakeData{Path.DirectorySeparatorChar}levels.json");
            DataFileNames.Add(typeof(SystemModel), $"FakeData{Path.DirectorySeparatorChar}systems.json");
            DataFileNames.Add(typeof(LogModel), $"FakeData{Path.DirectorySeparatorChar}logs.json");
            DataFileNames.Add(typeof(RoleModel), $"FakeData{Path.DirectorySeparatorChar}roles.json");

            var configuration = new MapperConfiguration(cfg => {
                cfg.CreateMap <UserModel, UserDTO>().ReverseMap();
                cfg.CreateMap <LogModel, LogDTO>().ReverseMap();
            });

            Mapper = configuration.CreateMapper();
        }