示例#1
0
        public void Defaults()
        {
            var test = new SampleAndErrorsInformation();

            Assert.AreEqual(-1, test.NumErrors);
            Assert.AreEqual(0, test.Errors.Count);
            Assert.AreEqual(0, test.Samples.Count);
        }
示例#2
0
        public void AddSamples()
        {
            var test = new SampleAndErrorsInformation();

            test.Samples.Add(new SampleRecordEntry(20, true));
            Assert.AreEqual(1, test.Samples.Count);
            test.Samples.Add(new SampleRecordEntry(20, false));
            Assert.AreEqual(2, test.Samples.Count);
            test.Samples = new ObservableCollection <SampleRecordEntry>
            {
                new SampleRecordEntry(1, true), new SampleRecordEntry(2, true), new SampleRecordEntry(3, true)
            };
            Assert.AreEqual(3, test.Samples.Count);
        }
示例#3
0
        public void AddError()
        {
            var test = new SampleAndErrorsInformation();

            test.Errors.Add(new SampleRecordEntry(10, "ErrorText"));
            Assert.AreEqual(1, test.NumErrors);
            Assert.AreEqual(0, test.Samples.Count);
            test.Errors = new ObservableCollection <SampleRecordEntry>
            {
                new SampleRecordEntry(1, true), new SampleRecordEntry(2, true), new SampleRecordEntry(3, true)
            };
            Assert.AreEqual(3, test.NumErrors);
            Assert.AreEqual(0, test.Samples.Count);
        }
示例#4
0
        public void Equals()
        {
            var test = new SampleAndErrorsInformation();

            test.Errors.Add(new SampleRecordEntry(10, "ErrorText"));

            test.Samples.Add(new SampleRecordEntry(20, true));
            test.Samples.Add(new SampleRecordEntry(20, false));

            var test2 = test.Clone();

            Assert.IsTrue(test.Equals(test));
            Assert.IsTrue(test.Equals(test2));
            Assert.IsFalse(test.Equals(null));
        }
示例#5
0
        public void Clone()
        {
            var test = new SampleAndErrorsInformation();

            test.Errors.Add(new SampleRecordEntry(10, "ErrorText"));

            test.Samples.Add(new SampleRecordEntry(20, true));
            test.Samples.Add(new SampleRecordEntry(20, false));

            var test2 = test.Clone();

            Assert.IsTrue(test.Equals(test2));
            Assert.AreEqual(test.Errors[0], test2.Errors[0]);
            Assert.AreEqual(test.Samples[0], test2.Samples[0]);
        }