Beispiel #1
0
        public void srm_whenSameNameWithSpaceInPunctionaion_returnsTrue()
        {
            var srm1 = new Srm(5, "Deep Amber / Light Copper", 10, 14);
            var srm2 = new Srm(5, "Deep Amber/Light Copper", 10, 14);

            Assert.IsTrue(srm1.Equals(srm2));
        }
Beispiel #2
0
        public void SrmViewModel_setupIncorrectly_Fails()
        {
            var srm   = new Srm(1, "Straw", 2, 3);
            var srmVm = new SrmViewModel(srm);

            Assert.IsFalse(srmVm.Correct);
        }
Beispiel #3
0
        public void srm_whenSameNameWithoutPunctuation_returnsTrue2()
        {
            var srm1 = new Srm(12, "black, opaque", 40);
            var srm2 = new Srm(12, "black opaque", 40);

            Assert.IsTrue(srm1.Equals(srm2));
        }
Beispiel #4
0
        public void SrmViewModel_setupCorrectly_Succeeds()
        {
            var userSrm = new Srm(1, "Straw", 2, 3);
            var srmVm   = new SrmViewModel(userSrm);

            Assert.IsTrue(srmVm.Correct);
        }
Beispiel #5
0
 public SrmViewModel(Srm srm)
 {
     this.Id = srm.Id;
     this.Name = srm.Name;
     this.Low = srm.Low;
     this.High = srm.High;
 }
        public void SrmViewModel_setupCorrectly_Succeeds()
        {
            var userSrm = new Srm(1, "Straw", 2,3);
            var srmVm = new SrmViewModel(userSrm);

            Assert.IsTrue(srmVm.Correct);
        }
        public void SrmViewModel_setupIncorrectly_Fails()
        {
            var srm = new Srm(1, "Straw", 2, 3);
            var srmVm = new SrmViewModel(srm);

            Assert.IsFalse(srmVm.Correct);
        }
Beispiel #8
0
 public SrmViewModel(Srm srm)
 {
     this.Id   = srm.Id;
     this.Name = srm.Name;
     this.Low  = srm.Low;
     this.High = srm.High;
 }
Beispiel #9
0
        public void srm_yellow_equalsOtherYellow()
        {
            var srm1 = new Srm(2, "Yellow", 3, 4);
            var srm2 = new Srm(2, "Yellow", 3, 4);

            Assert.IsTrue(srm1.Equals(srm2));
        }
Beispiel #10
0
        public void srm_empty_equalsFalse()
        {
            var yellow = new Srm(2, "Yellow", 3, 4);
            var empty  = new Srm();

            Assert.IsFalse(yellow.Equals(empty));
        }
Beispiel #11
0
        public void srm_null_equalsFalse()
        {
            var yellow  = new Srm(2, "Yellow", 3, 4);
            Srm nullSrm = null;

            Assert.IsFalse(yellow.Equals(nullSrm));
        }
Beispiel #12
0
        //
        // GET: /Srm/

        public ActionResult Index()
        {
            var quiz = new SrmQuizViewModel();

            quiz.UserSrms = Srm.GetQuiz();
            quiz.Message  = "";
            return(View(quiz));
        }
Beispiel #13
0
        public ActionResult Index(SrmQuizViewModel quiz)
        {
            var comparer = new SrmComparer(Srm.GetMasterSrms());

            comparer.QuizSrms = quiz.UserSrms;
            quiz.Message      = comparer.IsCorrect() ? "Correct" : "Incorrect";
            return(View(quiz));
        }
Beispiel #14
0
        public void srm_yellow_isSetProperly()
        {
            var yellow = new Srm(2, "Yellow", 3, 4);

            Assert.AreEqual(2, yellow.Id);
            Assert.AreEqual("Yellow", yellow.Name);
            Assert.AreEqual(3, yellow.Low);
            Assert.AreEqual(4, yellow.High);
        }
Beispiel #15
0
        public void srm_straw_isSetProperly()
        {
            var straw = new Srm(1, "Straw", 2, 3);

            Assert.AreEqual(1, straw.Id);
            Assert.AreEqual("Straw", straw.Name);
            Assert.AreEqual(2, straw.Low);
            Assert.AreEqual(3, straw.High);
        }
Beispiel #16
0
 public MyBeer(Glass glass, Srm srm, Available available, Style style, List <Brewery> breweries, Labels labels,
               List <SocialAccount> socialAccounts)
 {
     Glass     = glass;
     Srm       = srm;
     Available = available;
     Style     = style;
     Breweries = breweries;
     Labels    = labels;
 }
        public void SrmViewModel_setup_hasPropertiesSet()
        {
            var srm = new Srm(1, "Straw", 2, 3);
            var srmVm = new SrmViewModel(srm);

            Assert.AreEqual(1, srmVm.Id);
            Assert.AreEqual("Straw", srmVm.Name);
            Assert.AreEqual(2, srmVm.Low);
            Assert.AreEqual(3, srmVm.High);
        }
Beispiel #18
0
        public void SrmViewModel_setup_hasPropertiesSet()
        {
            var srm   = new Srm(1, "Straw", 2, 3);
            var srmVm = new SrmViewModel(srm);

            Assert.AreEqual(1, srmVm.Id);
            Assert.AreEqual("Straw", srmVm.Name);
            Assert.AreEqual(2, srmVm.Low);
            Assert.AreEqual(3, srmVm.High);
        }
Beispiel #19
0
        private void btnRun_Click(object sender, EventArgs e)
        {
#if EX_SCRIPT
            Srm.RunCompiledScript(Script);
            Srm.InvokeFunctionIfExisted(((FunctionListItem)functionList.SelectedItem).Function.Name);
#endif // EX_SCRIPT
            if (chkCloseAfterRun.Checked)
            {
                Close();
            }
        }
Beispiel #20
0
        internal void RaiseRangeDataChangedEvent(RangePosition range)
        {
            if (!this.suspendDataChangedEvent)
            {
                if (RangeDataChanged != null)
                {
                    RangeDataChanged(this, new RangeEventArgs(range));
                }

#if EX_SCRIPT
                if (this.Srm != null && this.worksheetObj != null)
                {
                    var ondatachange = Srm.DefaultContext.EvaluatePropertyGet(this.worksheetObj, "ondatachange");

                    if (ondatachange != null)
                    {
                        Srm.InvokeFunctionIfExisted(this.worksheetObj, "ondatachange", new RSRangeObject(this, range));
                    }
                }
#endif
            }
        }
Beispiel #21
0
 public void srm_null_equalsFalse()
 {
     var yellow = new Srm(2, "Yellow", 3, 4);
     Srm nullSrm = null;
     Assert.IsFalse(yellow.Equals(nullSrm));
 }
Beispiel #22
0
        public void srm_quiz_hasNoNames()
        {
            var quiz = Srm.GetQuiz();

            Assert.IsTrue(quiz.All(srm => String.IsNullOrWhiteSpace(srm.Name)));
        }
Beispiel #23
0
        public void srm_black_stringIsDisplayed()
        {
            var black = new Srm(11, "Black", 30);

            Assert.AreEqual("Black - 30+", black.ToString());
        }
Beispiel #24
0
        public void srm_yellow_stringIsDisplayed()
        {
            var yellow = new Srm(2, "Yellow", 3, 4);

            Assert.AreEqual("Yellow - 3, 4", yellow.ToString());
        }
Beispiel #25
0
 public void srm_straw_isSetProperly()
 {
     var straw = new Srm(1, "Straw", 2, 3);
     Assert.AreEqual(1, straw.Id);
     Assert.AreEqual("Straw", straw.Name);
     Assert.AreEqual(2, straw.Low);
     Assert.AreEqual(3, straw.High);
 }
Beispiel #26
0
        public void Setup()
        {
            var orderedSrms = Srm.GetMasterSrms();

            comparer = new SrmComparer(orderedSrms);
        }
Beispiel #27
0
 public void srm_empty_equalsFalse()
 {
     var yellow = new Srm(2, "Yellow", 3, 4);
     var empty = new Srm();
     Assert.IsFalse(yellow.Equals(empty));
 }
Beispiel #28
0
 public void srm_whenSameNameWithoutPunctuation_returnsTrue2()
 {
     var srm1 = new Srm(12, "black, opaque", 40);
     var srm2 = new Srm(12, "black opaque", 40);
     Assert.IsTrue(srm1.Equals(srm2));
 }
Beispiel #29
0
 public void srm_black_stringIsDisplayed()
 {
     var black = new Srm(11, "Black", 30);
     Assert.AreEqual("Black - 30+", black.ToString());
 }
Beispiel #30
0
 public void srm_yellow_stringIsDisplayed()
 {
     var yellow = new Srm(2, "Yellow", 3, 4);
     Assert.AreEqual("Yellow - 3, 4", yellow.ToString());
 }
Beispiel #31
0
 public void srm_yellow_isSetProperly()
 {
     var yellow = new Srm(2, "Yellow", 3, 4);
     Assert.AreEqual(2, yellow.Id);
     Assert.AreEqual("Yellow", yellow.Name);
     Assert.AreEqual(3, yellow.Low);
     Assert.AreEqual(4, yellow.High);
 }
Beispiel #32
0
        public void srm_yellow_equalsOtherYellow()
        {
            var srm1 = new Srm(2, "Yellow", 3, 4);
            var srm2 = new Srm(2, "Yellow", 3, 4);

            Assert.IsTrue(srm1.Equals(srm2));
        }
Beispiel #33
0
        public void srm_whenSameNameWithSpaceInPunctionaion_returnsTrue()
        {
            var srm1 = new Srm(5, "Deep Amber / Light Copper", 10, 14);
            var srm2 = new Srm(5, "Deep Amber/Light Copper", 10, 14);

            Assert.IsTrue(srm1.Equals(srm2));
        }