Beispiel #1
0
        public void CreatePlantT()
        {
            //Arrange
            int     plantID   = 1;
            int     accID     = 0;
            int     daysWater = 3;
            string  nName     = "planty";
            Account acc       = new Account {
                ID = accID
            };
            AccountRepository accRepo = new AccountRepository();

            accRepo.GetAllPlants();
            //Act
            accRepo.AddPlant(plantID, accID, daysWater, nName);
            //Assert
            Assert.IsNotNull(acc.PlantList);
        }
Beispiel #2
0
        // -------------------------------   Plants    --------------------------------
        #region Plant

        /// <summary>
        /// Adds a plant to the database, that can then be used by users to add personal
        /// plants. Returns the plant ID of the plant that was added.
        /// </summary>
        /// <param name="cName">Common Name</param>
        /// <param name="lName">Latin Name</param>
        /// <param name="imageURL">Image URL</param>
        /// <param name="description">Description</param>
        /// <param name="sDays">Suggested Watering Days</param>
        /// <returns>The Plant ID. Returns 0 if not successful</returns>
        public int AddPlant(string cName, string lName, string imageURL, string description, int sDays)
        {
            return(accrepo.AddPlant(cName, lName, imageURL, description, sDays));
        }