Exemple #1
0
        public static Request Create(Home home)
        {
            var rnd = new Random();

            return(new Request
            {
                Id = Guid.NewGuid().ToString(),
                Date = DateTime.UtcNow,
                Type = RequestType.ToRent,
                User = UserCreator.Create("Miroslav", "Shpekov", "shpeka", "*****@*****.**"),
                Home = home,
                Status = RequestStatus.NA,
            });
        }
        public static Home CreateAny(int cityId)
        {
            var rnd = new Random();

            return(new Home
            {
                Name = Guid.NewGuid().ToString(),
                Description = Guid.NewGuid().ToString(),
                Address = $"{rnd.Next(5, 999)}, {Guid.NewGuid().ToString()}, {rnd.Next(1000, 9000)}",
                Price = rnd.Next(50, 999),
                Status = HomeStatus.ToRent,
                Category = HomeCategory.House,
                Owner = UserCreator.Create("Prasemir", "Butonoskov", "prasio", "*****@*****.**"),
                CityId = cityId,
            });
        }
        public static Home CreateManagedHome(string ownerId, int cityId)
        {
            var rnd = new Random();

            var home = new Home
            {
                Name        = Guid.NewGuid().ToString(),
                Description = Guid.NewGuid().ToString(),
                Address     = $"{rnd.Next(5, 999)}, {Guid.NewGuid().ToString()}, {rnd.Next(1000, 9000)}",
                Price       = rnd.Next(50, 10000),
                Status      = HomeStatus.Managed,
                Category    = (HomeCategory)rnd.Next(1, 3),
                OwnerId     = ownerId,
                Manager     = UserCreator.Create("Kanalin", "Tsolov", "tsola", "*****@*****.**"),
                CityId      = cityId,
            };

            home.ManagerId = home.Manager.Id;
            return(home);
        }