protected void SetUp()
 {
     factory = Factory.getInstance();
     o = new Order(1, new List<Burrito>(), DateTime.Now, false, false, Decimal.Parse("17.00"));
     b = new Burrito(1, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, Decimal.Parse("3.00"));
     o.burritos.Add(b);
 }
示例#2
0
        /// <summary>
        /// Checks if the objects are equal
        /// </summary>
        /// <returns>success or failure</returns>
        public override Boolean Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null || !this.GetType().Equals(obj.GetType()))
            {
                return(false);
            }

            Burrito other = (Burrito)obj;

            if (this.id != other.id || this.FlourTortilla != other.FlourTortilla || this.ChiliTortilla != other.ChiliTortilla || this.JalapenoCheddarTortilla != other.JalapenoCheddarTortilla ||
                this.TomatoBasilTortilla != other.TomatoBasilTortilla || this.HerbGarlicTortilla != other.HerbGarlicTortilla || this.WheatTortilla != other.WheatTortilla ||
                this.WhiteRice != other.WhiteRice || this.BrownRice != other.BrownRice || this.BlackBeans != other.BlackBeans || this.PintoBeans != other.PintoBeans ||
                this.Chicken != other.Chicken || this.Beef != other.Beef || this.Hummus != other.Hummus || this.SalsaPico != other.SalsaPico ||
                this.SalsaVerde != other.SalsaVerde || this.SalsaSpecial != other.SalsaSpecial || this.Guacamole != other.Guacamole || this.Lettuce != other.Lettuce ||
                this.Jalapenos != other.Jalapenos || this.Tomatoes != other.Tomatoes || this.Cucumber != other.Cucumber || this.Onion != other.Onion || this.Price != other.Price)
            {
                return(false);
            }

            return(true);
        }
        public void testBurritoSvc()
        {
            try {
                //week 3
                //IBurritoSvc ics = factory.getBurritoSvc();

                //week 4
                dLog.Debug("Going to get the service implementation");
                IBurritoSvc ics = (IBurritoSvc) factory.getService("IBurritoSvc");

                dLog.Debug("Going to create burrito");
                // First let's store the Burrito
                Assert.True(ics.storeBurrito(b));

                dLog.Debug("Going to read burrito");
                // Then let's read it back in
                b = ics.getBurrito(b.id);
                Assert.True(b.validate());

                // Update burrito
                dLog.Debug("Going to update burrito");
                b.Beef = false;
                b.Hummus = true;
                Assert.True(ics.storeBurrito(b));

                dLog.Debug("Going to delete burrito");
                // Finally, let's cleanup the file that was created
                Assert.True(ics.deleteBurrito(b.id));
            }
            catch(Exception e) {
                Console.WriteLine("Exception in testBurritoSvc: " + e.Message + "\n" + e.StackTrace);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
        public void testAddBurritoToOrder()
        {
            try
            {
                dLog.Info("Start testAddBurritoToOrder");
                o = new Order(rand.Next(), new List<Burrito>(), new DateTime(), false, false, new Decimal(0));
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));
                b.Price = bManager.calculatePrice(b);
                oManager.addBurritoToOrder(o, b);
                o.totalCost = oManager.calculateTotal(o);

                Assert.True(oManager.createOrder(o));

                Assert.True(oManager.addBurritoToOrder(o, b));

                Assert.True(oManager.deleteOrder(o));

                dLog.Info("Finish testAddBurritoToOrder");
            }
            catch (Exception e)
            {
                dLog.Error("Exception in testAddBurritoToOrder: " + e.Message);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
        public void testNotEqualsBurrito()
        {
            try {
                Burrito b = new Burrito(1, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, Decimal.Parse("0.00"));
                Burrito c = new Burrito();

                Assert.False(b.Equals(c));
            }
            catch(Exception e) {
                Console.WriteLine("Exception in testNotEqualsBurrito: " + e.Message + "\n" + e.StackTrace);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
        public void testInvalidBurrito()
        {
            try {
                Burrito b = new Burrito();
                b.id = -1;

                Assert.False(b.validate());
            }
            catch(Exception e) {
                Console.WriteLine("Exception in testInvalidBurrito: " + e.Message + "\n" + e.StackTrace);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
示例#7
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_i"></param>
        public void clearState(Inventory _i)
        {
            try
            {
                curInventory = _i;
                this.DialogResult = DialogResult.Cancel;
                newBurrito = new Burrito();

                //reset UI
                beefChk.Checked = false;
                ChickenChk.Checked = false;
                hummusChk.Checked = false;
                flourTorillaChk.Checked = false;
                herbGarlicChk.Checked = false;
                wheatChk.Checked = false;
                chiliChk.Checked = false;
                jalapenoCheddarChk.Checked = false;
                tomatoBasilChk.Checked = false;
                whiteRiceChk.Checked = false;
                brownRiceChk.Checked = false;
                blackBeansChk.Checked = false;
                pintoBeansChk.Checked = false;
                picoSalsaChk.Checked = false;
                salsaSpecialChk.Checked = false;
                salsaVerdeChk.Checked = false;
                guacamoleChk.Checked = false;
                lettuceChk.Checked = false;
                cucumbersChk.Checked = false;
                jalapenosChk.Checked = false;
                onionsChk.Checked = false;
                tomatoesChk.Checked = false;

                priceLbl.Text = "Total Price: $0.00";

                //initialize options based on inventory
                initAvailableOptions();
            }
            catch (Exception e)
            {
                dLog.Error("Exception in updateBurritoCost: " + e.Message);
            }
        }
示例#8
0
        /// <summary>
        /// 
        /// </summary>
        public BurritoDialog(Inventory _i)
        {
            try
            {
                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                bManager = (BurritoManager)ctx.GetObject("BurritoManager");

                rand = new Random();
                newBurrito = new Burrito();
                curInventory = _i;

                initAvailableOptions();
            }
            catch (Exception e)
            {
                dLog.Debug("Exception | Unable to initialize business layer components: " + e.Message + "\n" + e.StackTrace);
            }

            InitializeComponent();
        }
        public void testCreateBurrito()
        {
            try
            {
                dLog.Info("Start testCreateBurrito");
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));
                b.Price = bManager.calculatePrice(b);
                dLog.Debug("Burrito Price: " + b.Price);

                Assert.True(bManager.createBurrito(b));

                Assert.True(bManager.deleteBurrito(b));

                dLog.Info("Finish testCreateBurrito");
            }
            catch (Exception e)
            {
                dLog.Error("Exception in testCreateBurrito: " + e.Message);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
        public void testRemoveFromInventoryBurrito()
        {
            try
            {
                dLog.Info("Start testRemoveFromInventoryBurrito");
                i = new Inventory(rand.Next(), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250));
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));

                Assert.True(iManager.createInventory(i));

                Assert.True(iManager.removeFromInventory(i, b));

                Assert.True(iManager.deleteInventory(i));

                dLog.Info("Finish testRemoveFromInventoryBurrito");
            }
            catch (Exception e)
            {
                dLog.Error("Exception in testRemoveFromInventoryBurrito: " + e.Message);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
示例#11
0
        public void testValidBurrito()
        {
            try {
                Burrito b = new Burrito();
                b.id = 1;
                b.Beef = true;
                b.BlackBeans = true;
                b.BrownRice = true;
                b.Chicken = false;
                b.ChiliTortilla = false;
                b.Cucumber = true;
                b.FlourTortilla = false;
                b.Guacamole = true;
                b.HerbGarlicTortilla = true;
                b.Hummus = false;
                b.JalapenoCheddarTortilla = false;
                b.Jalapenos = true;
                b.Lettuce = true;
                b.Onion = false;
                b.PintoBeans = false;
                b.SalsaPico = true;
                b.SalsaSpecial = false;
                b.SalsaVerde = false;
                b.TomatoBasilTortilla = false;
                b.Tomatoes = false;
                b.WheatTortilla = false;
                b.WhiteRice = false;
                b.Price = Decimal.Parse("3.00");

                Assert.True(b.validate());
            }
            catch(Exception e) {
                Console.WriteLine("Exception in testValidBurrito: " + e.Message);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
示例#12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="o"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public Boolean addBurritoToOrder(Order o, Burrito b)
        {
            dLog.Debug("In addBurritoToOrder");
            Boolean result = false;

            try
            {
                if (b.validate())
                {
                    o.burritos.Add(b);

                    if (orderSvc.storeOrder(o))
                        result = true;
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in addBurritoToOrder: " + e.Message + "\n" + e.StackTrace);
                result = false;
            }

            dLog.Debug("addBurritoToOrder result: " + result);
            return result;
        }
示例#13
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="o"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public Boolean updateBurritoInOrder(Order o, Burrito b)
        {
            dLog.Debug("In updateBurritoInOrder");
            Boolean result = false;

            try
            {
                if (b.validate())
                {
                    var idx = 0;
                    foreach (Burrito b1 in o.burritos)
                    {
                        if (b1.id == b.id)
                        {
                            o.burritos[idx] = b;
                            result = true;
                            break;
                        }

                        idx++;
                    }

                    if (orderSvc.storeOrder(o))
                        result = true;
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in updateBurritoInOrder: " + e.Message + "\n" + e.StackTrace);
                result = false;
            }

            dLog.Debug("updateBurritoInOrder result: " + result);
            return result;
        }
        /// <summary>
        /// This method stores a burrito.
        /// </summary>
        /// <param name="b">The burrito object to store</param>
        /// <returns>Success/Failure</returns>
        public Boolean storeBurrito(Burrito b)
        {
            dLog.Info("Entering method storeBurrito | ID: " + b.id);
            Boolean result = false;

            try
            {
                MongoServer server = MongoServer.Create();
                MongoDatabase db = server.GetDatabase("neatoBurrito");
                //MongoCredentials credentials = new MongoCredentials("username", "password");
                //MongoDatabase salaries = server.GetDatabase("salaries", credentials);

                using (server.RequestStart(db))
                {
                    MongoCollection<BsonDocument> coll = db.GetCollection("burrito");
                    var query = new QueryDocument("id", b.id);

                    dLog.Debug("Finding if burrito exists");
                    BsonDocument myDoc = coll.FindOne(query);

                    query.Add("beef", b.Beef);
                    query.Add("blackBeans", b.BlackBeans);
                    query.Add("brownRice", b.BrownRice);
                    query.Add("chicken", b.Chicken);
                    query.Add("chiliTortilla", b.ChiliTortilla);
                    query.Add("cucumber", b.Cucumber);
                    query.Add("flourTortilla", b.FlourTortilla);
                    query.Add("guacamole", b.Guacamole);
                    query.Add("herbGarlicTortilla", b.HerbGarlicTortilla);
                    query.Add("hummus", b.Hummus);
                    query.Add("jalapenoCheddarTortilla", b.JalapenoCheddarTortilla);
                    query.Add("jalapenos", b.Jalapenos);
                    query.Add("lettuce", b.Lettuce);
                    query.Add("onion", b.Onion);
                    query.Add("orderID", b.orderID);
                    query.Add("pintoBeans", b.PintoBeans);
                    query.Add("price", b.Price.ToString());
                    query.Add("salsaPico", b.SalsaPico);
                    query.Add("salsaSpecial", b.SalsaSpecial);
                    query.Add("salsaVerde", b.SalsaVerde);
                    query.Add("tomatoBasilTortilla", b.TomatoBasilTortilla);
                    query.Add("tomatoes", b.Tomatoes);
                    query.Add("wheatTortilla", b.WheatTortilla);
                    query.Add("whiteRice", b.WhiteRice);

                    //ensure we were passed a valid object before attempting to write
                    if (myDoc == null)
                    {
                        dLog.Debug("Inserting burrito");
                        coll.Insert(query);

                        result = true;
                    }
                    else
                    {
                        var update = new UpdateDocument();
                        update.Add(query.ToBsonDocument());
                        dLog.Debug("Updating burrito");
                        dLog.Debug("myDoc: " + myDoc.ToString());
                        dLog.Debug("update Query: " + update.ToString());

                        SafeModeResult wr = coll.Update(new QueryDocument("id", b.id), update, SafeMode.True);

                        dLog.Debug("SafeModeResult: " + wr.Ok);
                        if (wr.LastErrorMessage == null && wr.Ok)
                        {
                            result = true;
                        }
                        else
                        {
                            dLog.Debug("SafeModeResult: " + wr.LastErrorMessage);
                        }
                    }
                }
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in storeBurrito: " + e2.Message);
            }
            finally
            {
                //using statement above already calls RequestDone()
            }

            return result;
        }
        /// <summary>
        /// This method retrieves a burrito.
        /// </summary>
        /// <param name="id">Unique ID of burrito to retrieve</param>
        /// <returns>burrito object</returns>
        public Burrito getBurrito(Int32 id)
        {
            dLog.Info("Entering method getBurrito | ID: " + id);
            Burrito b = new Burrito();

            try
            {
                MongoServer server = MongoServer.Create();
                MongoDatabase db = server.GetDatabase("neatoBurrito");
                //MongoCredentials credentials = new MongoCredentials("username", "password");
                //MongoDatabase salaries = server.GetDatabase("salaries", credentials);

                using (server.RequestStart(db))
                {
                    MongoCollection<BsonDocument> coll = db.GetCollection("burrito");
                    var query = new QueryDocument("id", id);

                    BsonDocument myDoc = coll.FindOne(query);

                    //ensure we were passed a valid object before attempting to read
                    if (myDoc != null)
                    {
                        dLog.Debug("myDoc: " + myDoc.ToString());

                        #region Read Fields
                        b.id = id;
                        b.Beef = myDoc["beef"].AsBoolean;
                        b.BlackBeans = myDoc["blackBeans"].AsBoolean;
                        b.BrownRice = myDoc["brownRice"].AsBoolean;
                        b.Chicken = myDoc["chicken"].AsBoolean;
                        b.ChiliTortilla = myDoc["chiliTortilla"].AsBoolean;
                        b.Cucumber = myDoc["cucumber"].AsBoolean;
                        b.FlourTortilla = myDoc["flourTortilla"].AsBoolean;
                        b.Guacamole = myDoc["guacamole"].AsBoolean;
                        b.HerbGarlicTortilla = myDoc["herbGarlicTortilla"].AsBoolean;
                        b.Hummus = myDoc["hummus"].AsBoolean;
                        b.JalapenoCheddarTortilla = myDoc["jalapenoCheddarTortilla"].AsBoolean;
                        b.Jalapenos = myDoc["jalapenos"].AsBoolean;
                        b.Lettuce = myDoc["lettuce"].AsBoolean;
                        b.Onion = myDoc["onion"].AsBoolean;
                        b.orderID = myDoc["orderID"].AsInt32;
                        b.PintoBeans = myDoc["pintoBeans"].AsBoolean;
                        b.Price = Decimal.Parse(myDoc["price"].AsString);
                        b.SalsaPico = myDoc["salsaPico"].AsBoolean;
                        b.SalsaSpecial = myDoc["salsaSpecial"].AsBoolean;
                        b.SalsaVerde = myDoc["salsaVerde"].AsBoolean;
                        b.TomatoBasilTortilla = myDoc["tomatoBasilTortilla"].AsBoolean;
                        b.Tomatoes = myDoc["tomatoes"].AsBoolean;
                        b.WheatTortilla = myDoc["wheatTortilla"].AsBoolean;
                        b.WhiteRice = myDoc["whiteRice"].AsBoolean;
                        #endregion
                    }
                    dLog.Debug("Finishing setting burrito");
                }
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in getBurrito: " + e2.Message + "\n" + e2.StackTrace);
                b = new Burrito();
            }
            finally
            {
                //using statement above already calls RequestDone()
            }

            return b;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="i"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public Boolean returnToInventory(Inventory i, Burrito b)
        {
            dLog.Debug("In returnToInventory");
            Boolean result = false;

            try
            {
                if (i.validate() && b.validate())
                {
                    // add burrito ingredients to inventory
                    if (b.Beef) i.setBeefQty(i.BeefQty + 1);
                    if (b.Chicken) i.setChickenQty(i.ChickenQty + 1);
                    if (b.Hummus) i.setHummusQty(i.HummusQty + 1);

                    //calculate remaining extras
                    if (b.ChiliTortilla) i.setChiliTortillaQty(i.ChiliTortillaQty + 1);
                    if (b.HerbGarlicTortilla) i.setHerbGarlicTortillaQty(i.HerbGarlicTortillaQty + 1);
                    if (b.JalapenoCheddarTortilla) i.setJalapenoCheddarTortillaQty(i.JalapenoCheddarTortillaQty + 1);
                    if (b.TomatoBasilTortilla) i.setTomatoBasilTortillaQty(i.TomatoBasilTortillaQty + 1);
                    if (b.WheatTortilla) i.setWheatTortillaQty(i.WheatTortillaQty + 1);
                    if (b.FlourTortilla) i.setFlourTortillaQty(i.FlourTortillaQty + 1);

                    if (b.WhiteRice) i.setWhiteRiceQty(i.WhiteRiceQty + 1);
                    if (b.BrownRice) i.setBrownRiceQty(i.BrownRiceQty + 1);

                    if (b.BlackBeans) i.setBlackBeansQty(i.BlackBeansQty + 1);
                    if (b.PintoBeans) i.setPintoBeansQty(i.PintoBeansQty + 1);

                    if (b.SalsaPico) i.setSalsaPicoQty(i.SalsaPicoQty + 1);
                    if (b.SalsaSpecial) i.setSalsaSpecialQty(i.SalsaSpecialQty + 1);
                    if (b.SalsaVerde) i.setSalsaVerdeQty(i.SalsaVerdeQty + 1);

                    if (b.Guacamole) i.setGuacamoleQty(i.GuacamoleQty + 1);

                    if (b.Cucumber) i.setCucumberQty(i.CucumberQty + 1);
                    if (b.Jalapenos) i.setJalapenosQty(i.JalapenosQty + 1);
                    if (b.Lettuce) i.setLettuceQty(i.LettuceQty + 1);
                    if (b.Onion) i.setOnionQty(i.OnionQty + 1);
                    if (b.Tomatoes) i.setTomatoesQty(i.TomatoesQty + 1);

                    // ensure the inventory gets updated
                    if (inventorySvc.storeInventory(i))
                    {
                        result = true;
                    }
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in returnToInventory: " + e.Message + "\n" + e.StackTrace);
                result = false;
            }

            dLog.Debug("returnToInventory result: " + result);
            return result;
        }
示例#17
0
        /// <summary>
        /// This method retrieves a order.
        /// </summary>
        /// <param name="id">Unique ID of order to retrieve</param>
        /// <returns>order object</returns>
        public Order getOrder(Int32 id)
        {
            dLog.Info("Entering method getOrder | ID: " + id);
            Order o = new Order();
            SqlDataReader rs = null;
            SqlConnection conn = null;
            SqlCommand stmt = null;

            try
            {
                String sqlStr = "SELECT isComplete, orderDate, isSubmitted, totalCost, Beef, BlackBeans, BrownRice, Chicken, ChiliTortilla, Cucumber, FlourTortilla, Guacamole, ";
                sqlStr += "HerbGarlicTortilla, Hummus, JalapenoCheddarTortilla, Jalapenos, Lettuce, Onion, b.orderID, PintoBeans, Price, SalsaPico, SalsaSpecial, SalsaVerde, ";
                sqlStr += "TomatoBasilTortilla, Tomatoes, WheatTortilla, WhiteRice, b.id FROM Orders o LEFT JOIN Burrito b on o.id = b.orderID WHERE o.id = @id";

                conn = new SqlConnection(connString);
                conn.Open();
                stmt = new SqlCommand(sqlStr, conn);
                stmt.Parameters.Add(new SqlParameter("@id", id));
                rs = stmt.ExecuteReader();

                while (rs.Read())
                {
                    Int32 tID;
                    dLog.Info("Got the " + rs.FieldCount + " fields of the record ");
                    o.id = id;

                    #region Read Fields
                    if(!rs.IsDBNull(0))
                        o.isComplete = rs.GetBoolean(0);
                    if(!rs.IsDBNull(1))
                        o.orderDate = rs.GetDateTime(1);
                    if(!rs.IsDBNull(2))
                        o.isSubmitted = rs.GetBoolean(2);
                    if(!rs.IsDBNull(3))
                        o.totalCost = rs.GetDecimal(3);

                    Burrito b = new Burrito();
                    if (!rs.IsDBNull(4))
                        b.Beef = rs.GetBoolean(4);
                    if (!rs.IsDBNull(5))
                        b.BlackBeans = rs.GetBoolean(5);
                    if (!rs.IsDBNull(6))
                        b.BrownRice = rs.GetBoolean(6);
                    if (!rs.IsDBNull(7))
                        b.Chicken = rs.GetBoolean(7);
                    if (!rs.IsDBNull(8))
                        b.ChiliTortilla = rs.GetBoolean(8);
                    if (!rs.IsDBNull(9))
                        b.Cucumber = rs.GetBoolean(9);
                    if (!rs.IsDBNull(10))
                        b.FlourTortilla = rs.GetBoolean(10);
                    if (!rs.IsDBNull(11))
                        b.Guacamole = rs.GetBoolean(11);
                    if (!rs.IsDBNull(12))
                        b.HerbGarlicTortilla = rs.GetBoolean(12);
                    if (!rs.IsDBNull(13))
                        b.Hummus = rs.GetBoolean(13);
                    if (!rs.IsDBNull(14))
                        b.JalapenoCheddarTortilla = rs.GetBoolean(14);
                    if (!rs.IsDBNull(15))
                        b.Jalapenos = rs.GetBoolean(15);
                    if (!rs.IsDBNull(16))
                        b.Lettuce = rs.GetBoolean(16);
                    if (!rs.IsDBNull(17))
                        b.Onion = rs.GetBoolean(17);
                    if (!rs.IsDBNull(18))
                        b.orderID = rs.GetInt32(18);
                    if (!rs.IsDBNull(19))
                        b.PintoBeans = rs.GetBoolean(19);
                    if (!rs.IsDBNull(20))
                        b.Price = rs.GetDecimal(20);
                    if (!rs.IsDBNull(21))
                        b.SalsaPico = rs.GetBoolean(21);
                    if (!rs.IsDBNull(22))
                        b.SalsaSpecial = rs.GetBoolean(22);
                    if (!rs.IsDBNull(23))
                        b.SalsaVerde = rs.GetBoolean(23);
                    if (!rs.IsDBNull(24))
                        b.TomatoBasilTortilla = rs.GetBoolean(24);
                    if (!rs.IsDBNull(25))
                        b.Tomatoes = rs.GetBoolean(25);
                    if (!rs.IsDBNull(26))
                        b.WheatTortilla = rs.GetBoolean(26);
                    if (!rs.IsDBNull(27))
                        b.WhiteRice = rs.GetBoolean(27);
                    if (!rs.IsDBNull(28) && Int32.TryParse(rs.GetString(14), out tID))
                        b.id = tID;

                    o.burritos.Add(b);
                    #endregion
                }
            }
            catch (SqlException e1)
            {
                dLog.Error("SqlException in getOrder: " + e1.Message + "\n" + e1.StackTrace);
                o = new Order();
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in getOrder: " + e2.Message + "\n" + e2.StackTrace);
                o = new Order();
            }
            finally
            {
                if (rs != null && !rs.IsClosed)
                    rs.Close();
                if (conn != null && conn.State == System.Data.ConnectionState.Open)
                    conn.Close();
            }

            return o;
        }
        public void testUpdateBurrito()
        {
            try
            {
                dLog.Info("Start testUpdateBurrito");
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));

                Assert.True(bManager.createBurrito(b));

                b.Beef = nextBool();
                b.ChiliTortilla = nextBool();
                b.BlackBeans = nextBool();
                b.Guacamole = nextBool();
                b.PintoBeans = nextBool();
                b.SalsaSpecial = nextBool();

                Assert.True(bManager.updateBurrito(b));

                Assert.True(bManager.deleteBurrito(b));

                dLog.Info("Finish testUpdateBurrito");
            }
            catch (Exception e)
            {
                dLog.Error("Exception in testUpdateBurrito: " + e.Message);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
        /// <summary>
        /// This method stores a burrito.
        /// </summary>
        /// <param name="b">The burrito object to store</param>
        /// <returns>Success/Failure</returns>
        public Boolean storeBurrito(Burrito b)
        {
            dLog.Info("Entering method storeBurrito | ID: " + b.id);
            Boolean result = false;
            SqlConnection conn = null;
            SqlCommand stmt = null;

            try
            {
                String sqlStr = "SELECT COUNT(1) FROM Burrito WHERE id = @id";

                conn = new SqlConnection(connString);
                conn.Open();
                stmt = new SqlCommand(sqlStr, conn);
                stmt.Parameters.Add(new SqlParameter("@id", b.id));

                if (Int32.Parse(stmt.ExecuteScalar().ToString()) > 0)
                {
                    //if first is a valid row, then we need to do an update
                    dLog.Info("Updating burrito in database");

                    sqlStr = "UPDATE Burrito SET Beef=@Beef, BlackBeans=@BlackBeans, BrownRice=@BrownRice, Chicken=@Chicken, ChiliTortilla=@ChiliTortilla, ";
                    sqlStr += "Cucumber=@Cucumber, FlourTortilla=@FlourTortilla, Guacamole=@Guacamole, HerbGarlicTortilla=@HerbGarlicTortilla, Hummus=@Hummus, ";
                    sqlStr += "JalapenoCheddarTortilla=@JalapenoCheddarTortilla, Jalapenos=@Jalapenos, Lettuce=@Lettuce, Onion=@Onion, OrderID=@OrderID, PintoBeans=@PintoBeans, ";
                    sqlStr += "Price=@Price, SalsaPico=@SalsaPico, SalsaSpecial=@SalsaSpecial, SalsaVerde=@SalsaVerde, TomatoBasilTortilla=@TomatoBasilTortilla, ";
                    sqlStr += "Tomatoes=@Tomatoes, WheatTortilla=@WheatTortilla, WhiteRice=@WhiteRice WHERE id=@id";
                }
                else
                {
                    //if first is null, then we need to do an insert
                    dLog.Info("Inserting burrito into database");

                    sqlStr = "INSERT INTO Burrito (Beef, BlackBeans, BrownRice, Chicken, ChiliTortilla, Cucumber,";
                    sqlStr += "FlourTortilla, Guacamole, HerbGarlicTortilla, Hummus, JalapenoCheddarTortilla, Jalapenos,";
                    sqlStr += "Lettuce, Onion, OrderID, PintoBeans, Price, SalsaPico, SalsaSpecial, SalsaVerde, TomatoBasilTortilla,";
                    sqlStr += "Tomatoes, WheatTortilla, WhiteRice, id) VALUES (@Beef, @BlackBeans, @BrownRice, @Chicken, @ChiliTortilla, @Cucumber,";
                    sqlStr += "@FlourTortilla, @Guacamole, @HerbGarlicTortilla, @Hummus, @JalapenoCheddarTortilla, @Jalapenos,";
                    sqlStr += "@Lettuce, @Onion, @OrderID, @PintoBeans, @Price, @SalsaPico, @SalsaSpecial, @SalsaVerde, @TomatoBasilTortilla,";
                    sqlStr += "@Tomatoes, @WheatTortilla, @WhiteRice, @id)";
                }

                dLog.Info("SQL Statement: " + sqlStr);
                stmt = new SqlCommand(sqlStr, conn);

                #region Add SQL Parameters
                stmt.Parameters.Add(new SqlParameter("@id", b.id));
                stmt.Parameters.Add(new SqlParameter("@Beef", b.Beef));
                stmt.Parameters.Add(new SqlParameter("@BlackBeans", b.BlackBeans));
                stmt.Parameters.Add(new SqlParameter("@BrownRice", b.BrownRice));
                stmt.Parameters.Add(new SqlParameter("@Chicken", b.Chicken));
                stmt.Parameters.Add(new SqlParameter("@ChiliTortilla", b.ChiliTortilla));
                stmt.Parameters.Add(new SqlParameter("@Cucumber", b.Cucumber));
                stmt.Parameters.Add(new SqlParameter("@FlourTortilla", b.FlourTortilla));
                stmt.Parameters.Add(new SqlParameter("@Guacamole", b.Guacamole));
                stmt.Parameters.Add(new SqlParameter("@HerbGarlicTortilla", b.HerbGarlicTortilla));
                stmt.Parameters.Add(new SqlParameter("@Hummus", b.Hummus));
                stmt.Parameters.Add(new SqlParameter("@JalapenoCheddarTortilla", b.JalapenoCheddarTortilla));
                stmt.Parameters.Add(new SqlParameter("@Jalapenos", b.Jalapenos));
                stmt.Parameters.Add(new SqlParameter("@Lettuce", b.Lettuce));
                stmt.Parameters.Add(new SqlParameter("@Onion", b.Onion));
                stmt.Parameters.Add(new SqlParameter("@OrderID", b.orderID));
                stmt.Parameters.Add(new SqlParameter("@PintoBeans", b.PintoBeans));
                stmt.Parameters.Add(new SqlParameter("@Price", b.Price));
                stmt.Parameters.Add(new SqlParameter("@SalsaPico", b.SalsaPico));
                stmt.Parameters.Add(new SqlParameter("@SalsaSpecial", b.SalsaSpecial));
                stmt.Parameters.Add(new SqlParameter("@SalsaVerde", b.SalsaVerde));
                stmt.Parameters.Add(new SqlParameter("@TomatoBasilTortilla", b.TomatoBasilTortilla));
                stmt.Parameters.Add(new SqlParameter("@Tomatoes", b.Tomatoes));
                stmt.Parameters.Add(new SqlParameter("@WheatTortilla", b.WheatTortilla));
                stmt.Parameters.Add(new SqlParameter("@WhiteRice", b.WhiteRice));
                #endregion

                if (stmt.ExecuteNonQuery() > 0)
                    result = true;
            }
            catch (SqlException e1)
            {
                dLog.Error("SqlException in storeBurrito: " + e1.Message);
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in storeBurrito: " + e2.Message);
            }
            finally
            {
                if (conn.State == System.Data.ConnectionState.Open)
                    conn.Close();
            }

            return result;
        }
        protected void SetUp()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            dLog.Info("Beginning BurritoManagerTestCase Setup");
            rand = new Random();

            try
            {
                //bManager = new BurritoManager();

                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                bManager = (BurritoManager)ctx.GetObject("BurritoManager");

                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));
            }
            catch (Exception e)
            {
                dLog.Error("Unable to initialize service/domain objects: " + e.Message + "\n" + e.InnerException + "\n" + e.StackTrace);
            }
            dLog.Info("Finishing BurritoManagerTestCase Setup");
        }
 protected void SetUp()
 {
     factory = Factory.getInstance();
     b = new Burrito(1, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, Decimal.Parse("3.00"));
 }
示例#22
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public Boolean createBurrito(Burrito b)
        {
            dLog.Debug("In createBurrito");
            Boolean result = false;

            try
            {
                dLog.Debug("Validating burrito object");
                if (b.validate())
                {
                    if (burritoSvc.storeBurrito(b))
                    {
                        result = true;
                    }
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in createBurrito: " + e.Message + "\n" + e.StackTrace);
                result = false;
            }

            dLog.Debug("createBurrito result: " + result);
            return result;
        }
示例#23
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public String getBurritoType(Burrito b)
        {
            String result = "Unknown";

            try
            {
                if (b.Beef)
                {
                    result = "Beef";
                }
                else if (b.Chicken)
                {
                    result = "Chicken";
                }
                else if (b.Hummus)
                {
                    result = "Hummus";
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in getBurritoType: " + e.Message + "\n" + e.StackTrace);
                result = "Unknown";
            }

            return result;
        }
示例#24
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public Boolean updateBurrito(Burrito b)
        {
            Boolean result = false;

            try
            {
                if (b.validate())
                {
                    if (burritoSvc.storeBurrito(b))
                    {
                        result = true;
                    }
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in updateBurrito: " + e.Message + "\n" + e.StackTrace);
                result = false;
            }

            return result;
        }
        /// <summary>
        /// This method stores a burrito.
        /// </summary>
        /// <param name="b">The burrito object to store</param>
        /// <returns>Success/Failure</returns>
        public Boolean storeBurrito(Burrito b)
        {
            dLog.Info("Entering method storeBurrito | ID: " + b.id);
            Boolean result = false;
            ISession session = null;

            try
            {
                using (session = getSession())
                {
                    using (ITransaction transaction = session.BeginTransaction())
                    {
                        session.Save(b);
                        transaction.Commit();

                        if (transaction.WasCommitted)
                            result = true;
                    }
                }
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in storeBurrito: " + e2.Message);
            }
            finally
            {
                //ensure that session is close regardless of the errors in try/catch
                if (session != null && session.IsOpen)
                    session.Close();
            }

            return result;
        }
示例#26
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public Decimal calculatePrice(Burrito b)
        {
            dLog.Debug("In calculatePrice");
            Decimal result = new Decimal(-1);

            try
            {
                //check for valid burrito
                if (b.validate())
                {
                    result = new Decimal(0);

                    // first determine base type of Beef, Chicken, or Hummus by order of cost then determine extras
                    if (b.Beef)
                    {
                        result = result + Prices.getItemPrice("BeefBurrito");

                        //add extra main
                        if (b.Chicken)
                            result = result + Prices.getItemPrice("ExtraMeat");
                        if (b.Hummus)
                            result = result + Prices.getItemPrice("ExtraBeans");
                    }
                    else if (b.Chicken)
                    {
                        result = result + Prices.getItemPrice("BeefBurrito");

                        if (b.Hummus)
                            result = result + Prices.getItemPrice("ExtraBeans");
                    }
                    else if (b.Hummus)
                    {
                        result = result + Prices.getItemPrice("HummusBurrito");
                    }

                    // calculate remaining extras
                    if (b.ChiliTortilla || b.HerbGarlicTortilla || b.JalapenoCheddarTortilla || b.TomatoBasilTortilla || b.WheatTortilla)
                        result = result + Prices.getItemPrice("FlavoredTortilla");

                    if (b.WhiteRice && b.BrownRice)
                        result = result + Prices.getItemPrice("ExtraRice");

                    if (b.BlackBeans && b.PintoBeans)
                        result = result + Prices.getItemPrice("ExtraBeans");

                    if (b.SalsaPico && b.SalsaSpecial && b.SalsaVerde)
                        result = result + Prices.getItemPrice("ExtraSalsa");

                    if (b.Guacamole)
                        result = result + Prices.getItemPrice("Guacamole");
                }
            }
            catch (Exception e)
            {
                dLog.Debug("Exception in calculatePrice: " + e.Message + "\n" + e.StackTrace);
                result = new Decimal(-1);
            }

            dLog.Debug("calculatePrice result: " + result);
            return result;
        }
示例#27
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="b"></param>
        public void setBurrito(Burrito b)
        {
            try
            {
                newBurrito = b;

                //set burrito Items
                beefChk.Checked = newBurrito.Beef;
                ChickenChk.Checked = newBurrito.Chicken;
                hummusChk.Checked = newBurrito.Hummus;

                chiliChk.Checked = newBurrito.ChiliTortilla;
                herbGarlicChk.Checked = newBurrito.HerbGarlicTortilla;
                jalapenoCheddarChk.Checked = newBurrito.JalapenoCheddarTortilla;
                tomatoBasilChk.Checked = newBurrito.TomatoBasilTortilla;
                wheatChk.Checked = newBurrito.WheatTortilla;
                flourTorillaChk.Checked = newBurrito.FlourTortilla;

                whiteRiceChk.Checked = newBurrito.WhiteRice;
                brownRiceChk.Checked = newBurrito.BrownRice;

                blackBeansChk.Checked = newBurrito.BlackBeans;
                pintoBeansChk.Checked = newBurrito.PintoBeans;

                picoSalsaChk.Checked = newBurrito.SalsaPico;
                salsaSpecialChk.Checked = newBurrito.SalsaSpecial;
                salsaVerdeChk.Checked = newBurrito.SalsaVerde;

                guacamoleChk.Checked = newBurrito.Guacamole;

                cucumbersChk.Checked = newBurrito.Cucumber;
                jalapenosChk.Checked = newBurrito.Jalapenos;
                lettuceChk.Checked = newBurrito.Lettuce;
                onionsChk.Checked = newBurrito.Onion;
                tomatoesChk.Checked = newBurrito.Tomatoes;

                updateBurritoCost();
            }
            catch (Exception e)
            {
                dLog.Error("Exception in updateBurritoCost: " + e.Message);
            }
        }
        /// <summary>
        /// This method stores a burrito.
        /// </summary>
        /// <param name="b">The burrito object to store</param>
        /// <returns>Success/Failure</returns>
        public Boolean storeBurrito(Burrito b)
        {
            dLog.Info("Entering method storeBurrito | ID: "+b.id);
            Stream output = null;
            Boolean result = false;

            try {
                //ensure we were passed a valid object before attempting to write
                if (b.validate())
                {
                    dLog.Debug("Burrito object is valid, writing to file");
                    output = File.Open("Burrito_" + b.id + ".txt", FileMode.Create);
                    BinaryFormatter bFormatter = new BinaryFormatter();
                    bFormatter.Serialize(output, b);
                    result = true;
                }
                else
                    dLog.Debug("Burrito object is not valid");
            }
            catch (IOException e1) {
                dLog.Error("IOException in storeBurrito: " + e1.Message);
                result = false;
            }
            catch(Exception e2) {
                dLog.Error("Exception in storeBurrito: " + e2.Message);
                result = false;
            }
            finally {
                //ensure that output is close regardless of the errors in try/catch
                if(output != null) {
                    output.Close();
                }
            }

            return result;
        }
        /// <summary>
        /// This method retrieves a order.
        /// </summary>
        /// <param name="id">Unique ID of order to retrieve</param>
        /// <returns>order object</returns>
        public Order getOrder(Int32 id)
        {
            dLog.Info("Entering method getOrder | ID: " + id);
            Order o = new Order();

            try
            {
                MongoServer server = MongoServer.Create();
                MongoDatabase db = server.GetDatabase("neatoBurrito");
                //MongoCredentials credentials = new MongoCredentials("username", "password");
                //MongoDatabase salaries = server.GetDatabase("salaries", credentials);

                using (server.RequestStart(db))
                {
                    MongoCollection<BsonDocument> coll = db.GetCollection("order");
                    var query = new QueryDocument("id", id);

                    BsonDocument myDoc = coll.FindOne(query);

                    //ensure we were passed a valid object before attempting to read
                    if (myDoc != null)
                    {
                        dLog.Debug("myDoc: " + myDoc.ToString());

                        #region Read Order Fields
                        o.id = id;
                        o.isComplete = myDoc["isComplete"].AsBoolean;
                        o.isSubmitted = myDoc["isSubmitted"].AsBoolean;
                        o.orderDate = myDoc["orderDate"].AsDateTime;
                        o.totalCost = Decimal.Parse(myDoc["totalCost"].AsString);
                        #endregion

                        //get burritos
                        dLog.Debug("Getting burritos");
                        coll = db.GetCollection("burrito");
                        query.Clear();
                        query.Add("orderID", id);
                        MongoCursor cur = coll.Find(query);

                        o.burritos = new List<Burrito>();

                        foreach (var doc in cur)
                        {
                            myDoc = (BsonDocument)doc;
                            Burrito b = new Burrito();

                            //cleaner but too many extra queries this way
                            //o.burritos.Add(burritoSvc.getBurrito(myDoc["id"].AsInt32));

                            #region Read burrito Fields
                            b.id = id;
                            b.Beef = myDoc["beef"].AsBoolean;
                            b.BlackBeans = myDoc["blackBeans"].AsBoolean;
                            b.BrownRice = myDoc["brownRice"].AsBoolean;
                            b.Chicken = myDoc["chicken"].AsBoolean;
                            b.ChiliTortilla = myDoc["chiliTortilla"].AsBoolean;
                            b.Cucumber = myDoc["cucumber"].AsBoolean;
                            b.FlourTortilla = myDoc["flourTortilla"].AsBoolean;
                            b.Guacamole = myDoc["guacamole"].AsBoolean;
                            b.HerbGarlicTortilla = myDoc["herbGarlicTortilla"].AsBoolean;
                            b.Hummus = myDoc["hummus"].AsBoolean;
                            b.JalapenoCheddarTortilla = myDoc["jalapenoCheddarTortilla"].AsBoolean;
                            b.Jalapenos = myDoc["jalapenos"].AsBoolean;
                            b.Lettuce = myDoc["lettuce"].AsBoolean;
                            b.Onion = myDoc["onion"].AsBoolean;
                            b.orderID = myDoc["orderID"].AsInt32;
                            b.PintoBeans = myDoc["pintoBeans"].AsBoolean;
                            b.Price = Decimal.Parse(myDoc["price"].AsString);
                            b.SalsaPico = myDoc["salsaPico"].AsBoolean;
                            b.SalsaSpecial = myDoc["salsaSpecial"].AsBoolean;
                            b.SalsaVerde = myDoc["salsaVerde"].AsBoolean;
                            b.TomatoBasilTortilla = myDoc["tomatoBasilTortilla"].AsBoolean;
                            b.Tomatoes = myDoc["tomatoes"].AsBoolean;
                            b.WheatTortilla = myDoc["wheatTortilla"].AsBoolean;
                            b.WhiteRice = myDoc["whiteRice"].AsBoolean;
                            #endregion

                            o.burritos.Add(b);
                        }
                    }
                    dLog.Debug("Finishing setting order");
                }
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in getOrder: " + e2.Message + "\n" + e2.StackTrace);
                o = new Order();
            }
            finally
            {
                //using statement above already calls RequestDone()
            }

            return o;
        }
        /// <summary>
        /// This method retrieves a burrito.
        /// </summary>
        /// <param name="id">Unique ID of burrito to retrieve</param>
        /// <returns>burrito object</returns>
        public Burrito getBurrito(Int32 id)
        {
            dLog.Info("Entering method getBurrito | ID: " + id);
            Burrito b = new Burrito();
            ISession session = null;

            try {
                using (session = getSession()) {
                    using (ITransaction transaction = session.BeginTransaction())
                    {
                        IQuery query = session.CreateQuery(@"FROM Burrito WHERE id = :id");
                        query.SetParameter("id", id);

                        b = query.List<Burrito>()[0];
                    }

                }
            }
            catch (Exception e2)
            {
                dLog.Error("Exception in getBurrito: " + e2.Message + "\n" + e2.StackTrace);
                b = new Burrito();
            }
            finally
            {
                //ensure that session is close regardless of the errors in try/catch
                if (session != null && session.IsOpen)
                    session.Close();
            }

            return b;
        }
        protected void SetUp()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            dLog.Info("Beginning InventoryManagerTestCase Setup");
            rand = new Random();

            try {
                //iManager = new InventoryManager();
                //oManager = new OrderManager();

                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");
                oManager = (OrderManager)ctx.GetObject("OrderManager");

                i = new Inventory(rand.Next(), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250));
                o = new Order(rand.Next(), new List<Burrito>(), new DateTime(), false, false, new Decimal(0));
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));
            }
            catch (Exception e)
            {
                dLog.Error("Unable to initialize service/domain objects: " + e.Message + "\n" + e.StackTrace);
            }
            dLog.Info("Finishing InventoryManagerTestCase Setup");
        }