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);
        }
Example #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();
        }
Example #5
0
        /// <summary>
        /// Main constructor.
        /// </summary>
        public Core(DataFileNames fileNames, FrmActDataLoad.DataSet data, List <Compound> compounds, List <Pathway> pathways, MetaInfoHeader compMeta, MetaInfoHeader pathMeta, List <Adduct> adducts, MetaInfoHeader adductsHeader, MetaInfoHeader annotationsHeader)
        {
            this.CoreGuid = Guid.NewGuid();

            this.FileNames = fileNames;
            this.Options   = new CoreOptions()
            {
                Core = this
            };
            this.Options.ViewTypes = new List <GroupInfo>(data.Types.OrderBy(z => z.DisplayPriority));

            this._adducts      = adducts;
            this._peaks        = data.Peaks;
            this._compounds    = compounds;
            this._pathways     = pathways;
            this._observations = data.Observations;
            this._conditions   = data.Conditions;
            this._groups       = data.Types;
            this._batches      = data.Batches;

            this._peakMeta        = data.PeakMetaHeader;
            this._obsMeta         = data.ObsMetaHeader;
            this._compoundsMeta   = compMeta;
            this._pathwaysMeta    = pathMeta;
            this._adductsMeta     = adductsHeader;
            this._annotationsMeta = annotationsHeader;

            this._clusterers  = new List <ConfigurationClusterer>();
            this._statistics  = new List <ConfigurationStatistic>();
            this._corrections = new List <ConfigurationCorrection>();
            this._trends      = new List <ConfigurationTrend>();
            this._peakFilters = new List <PeakFilter>();
            this._obsFilters  = new List <ObsFilter>();
            this._alises      = new List <ProviderAlias>();

            this._cache = new CachedData(this);

            this._originalData = new List <OriginalData>();
            this._originalData.Add(data.IntensityMatrix);

            if (data.AltIntensityMatrix != null)
            {
                this._originalData.Add(data.AltIntensityMatrix);
            }

            this._alises.Add(new ProviderAlias(this, EProviderAlias.LastCorrection, null)
            {
                OverrideDisplayName = "Latest correction"
            });
            this._alises.Add(new ProviderAlias(this, EProviderAlias.LastTrend, null)
            {
                OverrideDisplayName = "Latest trend"
            });
        }
Example #6
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");
        }
Example #7
0
        internal FrmActOldData(DataFileNames dfn)
            : this()
        {
            Version file    = dfn.AppVersion;
            Version current = UiControls.Version;
            string  older   = (file < current) ? "older" : "newer";

            this.ctlTitleBar1.SubText = this.ctlTitleBar1.SubText.Replace("{older}", older).Replace("{product}", UiControls.Title);
            this.Text = dfn.Title;
            this._dfn = dfn;

            // UiControls.CompensateForVisualStyles(this);
        }
Example #8
0
        internal static bool Show(Form owner, DataFileNames dfn)
        {
            // Clear session filename to avoid accidentally saving corrupt information
            dfn.ForceSaveAs = true;

            if (DoNotShowAgain)
            {
                return(true);
            }

            using (FrmActOldData frm = new FrmActOldData(dfn))
            {
                return(UiControls.ShowWithDim(owner, frm) == DialogResult.OK);
            }
        }
Example #9
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");
        }
Example #10
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();
        }
Example #11
0
 internal void AddRecentWorkspace(DataFileNames fileNames)
 {
     this.RecentWorkspaces.RemoveAll(λ => λ.Title == fileNames.Title);
     this.RecentWorkspaces.Add(fileNames);
     ArrayHelper.TrimList(this.RecentWorkspaces, MAX_RECENT_WORKSPACES);
 }