Esempio n. 1
0
 public static Project CreateValidNewProject(ProjectTemplateDbContext database, Group group = null)
 {
     return(new Project()
     {
         Name = RandomFactory.GetCodeName(),
         Group = group ?? GetRandomGroup(database)
     });
 }
Esempio n. 2
0
 public static Group CreateValidNewGroup(ProjectTemplateDbContext database, string name = "")
 {
     return(new Group()
     {
         Name = name.Length == 0 ? RandomFactory.GetAlphanumericString(8) : name,
         IsActive = RandomFactory.GetBoolean()
     });
 }
Esempio n. 3
0
        // Create a new library
        public static Library CreateValidNewLibrary(ProjectTemplateDbContext database, string name = "")
        {
            // Create a new random address
            var address = new Address()
            {
                LocationAddressLine1  = RandomFactory.GetStreetAddress(),
                LocationAddressLine2  = "",
                LocationCity          = RandomFactory.GetCity(),
                LocationStateProvince = RandomFactory.GetState(),
                LocationZipCode       = RandomFactory.GetZip(),
                LocationCountry       = "US"
            };

            var library = new Library()
            {
                Name    = RandomFactory.GetLibraryName(),
                Address = address
            };

            return(library);
        }