Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of class SampleReference.
        /// </summary>
        /// <param name="role">The role of the sample in the ExperimentStep.</param>
        /// <param name="samplePurpose">The purpose of the sample in the ExperimentStep.</param>
        public SampleInheritance(string role, SamplePurpose samplePurpose)
        {
            Guard.AgainstNullOrEmpty(nameof(role), role);

            this.Role          = role;
            this.SamplePurpose = samplePurpose;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of class SampleReference.
        /// </summary>
        /// <param name="sampleId">The identifier of the referenced sample.</param>
        /// <param name="role">The role of the sample in the ExperimentStep.</param>
        /// <param name="samplePurpose">The purpose of the sample in the ExperimentStep.</param>
        public SampleReference(string sampleId, string role, SamplePurpose samplePurpose)
        {
            Guard.AgainstNullOrEmpty(nameof(sampleId), sampleId);
            Guard.AgainstNullOrEmpty(nameof(role), role);

            this.SampleId      = sampleId;
            this.Role          = role;
            this.SamplePurpose = samplePurpose;
        }
Ejemplo n.º 3
0
        internal static string GetXmlRepresentation(this SamplePurpose samplePurpose)
        {
            switch (samplePurpose)
            {
            case SamplePurpose.Produced:
            {
                return("produced");
            }

            case SamplePurpose.Consumed:
            {
                return("consumed");
            }

            default:
            {
                throw new ArgumentException("Specified SamplePurpose value is not valid.");
            }
            }
        }
Ejemplo n.º 4
0
 public SampleReferenceBuilder(string sampleId, string role, SamplePurpose samplePurpose)
 {
     this.sampleReference = new SampleReference(sampleId, role, samplePurpose);
 }
Ejemplo n.º 5
0
 public SampleInheritanceBuilder(string role, SamplePurpose samplePurpose)
 {
     this.sampleInheritance = new SampleInheritance(role, samplePurpose);
 }
Ejemplo n.º 6
0
        public static void Initialize(SamplesRequestDBContext context)
        {
            context.Database.EnsureCreated();

            if (context.SamplesPriorities.Any() && context.SamplesPurposes.Any() && context.Users.Any())
            {
                return;
            }

            var priorities = new SamplePriority[]
            {
                new SamplePriority {
                    name = "Low", key = "LPI"
                },
                new SamplePriority {
                    name = "Medium", key = "MPI"
                },
                new SamplePriority {
                    name = "High", key = "HPI"
                }
            };

            foreach (SamplePriority priority in priorities)
            {
                context.SamplesPriorities.Add(priority);
            }
            context.SaveChanges();

            var purposes = new SamplePurpose[]
            {
                new SamplePurpose {
                    name = "Agency Validation", key = "APU"
                },
                new SamplePurpose {
                    name = "Customer Validation", key = "CPU"
                },
                new SamplePurpose {
                    name = "Internal Validation", key = "IPU"
                }
            };

            foreach (SamplePurpose purpose in purposes)
            {
                context.SamplesPurposes.Add(purpose);
            }
            context.SaveChanges();

            var users = new User[]
            {
                new User {
                    uname = "WORLD/acarrasc", name = "Alejandro Carrasco", email = "*****@*****.**"
                },
                new User {
                    uname = "WORLD/Adalberto.Chavez", name = "Adalberto Chavez", email = "*****@*****.**"
                },
                new User {
                    uname = "WORLD/Ana.Alvarado", name = "Ana Alvarado", email = "*****@*****.**"
                },
                new User {
                    uname = "WORDL/Andrew.Lager", name = "Andrew Lager", email = "*****@*****.**"
                }
            };

            foreach (User user in users)
            {
                context.Users.Add(user);
            }
            context.SaveChanges();
        }