示例#1
0
 public void TestPriceNegative()
 {
     #region  arrange
     Syroup c = new Syroup();
     #endregion
     #region  act
     c.price = -5;
     c.name  = "test";
     #endregion
     #region  assert
     Assert.Equal(validation_result.pricing_incorrect, c.IsValid());
     #endregion
 }
示例#2
0
        public void TestWithoutName()
        {
            #region  arrange
            Syroup c = new Syroup();
            #endregion
            #region  act
            c.price = 5;
            c.name  = null;
            #endregion
            #region  assert
            Assert.Equal(validation_result.name_inccorect, c.IsValid());

            #endregion
        }
示例#3
0
        public void TestPricePositive()
        {
            #region  arrange
            Syroup c = new Syroup();
            #endregion
            #region  act
            c.price = 5;
            c.name  = "Mycoffee";
            #endregion
            #region  assert
            Assert.Equal(validation_result.succes, c.IsValid());

            #endregion
        }
示例#4
0
        public void loadfromfile(string path)
        {
            var culture = CultureInfo.CreateSpecificCulture("en-US");

            string[] lines = File.ReadAllLines(path);
            for (int i = 1; i < lines.Length; i++)
            {
                var    line  = lines[i];
                var    split = line.Split(',');
                Syroup aux   = new Syroup();
                aux.name    = split[0];
                aux.flavour = (eflavour_syroup)float.Parse(split[1]);
                aux.price   = float.Parse(split[2], culture);
                SyroupMenuList.Add(aux);
            }
        }