Exemplo n.º 1
0
        public void can_validate()
        {
            sut = new Normalschein();
            Assert.That(sut.IsValid(), Is.False);
            X.printValidationErros(new Auftrag(sut));

            sut = new Normalschein(new Normalfeld(1));
            Assert.That(sut.IsValid(), Is.False);
            X.printValidationErros(new Auftrag(sut));

            sut = new Normalschein(new Normalfeld(ZahlRandomiser.many(7)));
            Assert.That(sut.IsValid(), Is.False);
            X.printValidationErros(new Auftrag(sut));

            sut = new Normalschein(new Normalfeld(ZahlRandomiser.many(6)));
            Assert.That(sut.IsValid());

            sut = new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 6));
            Assert.That(sut.IsValid());

            sut = new Normalschein(new Normalfeld().quick() as Normalfeld);
            Assert.That(sut.IsValid());

            sut = new Normalschein( new Normalfeld().quick() as Normalfeld, new Normalfeld());
            Assert.That(sut.IsValid());
        }
Exemplo n.º 2
0
 public void can_reset()
 {
     sut = new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 6));
     Assert.IsFalse(sut.IsEmpty());
     sut.reset();
     Assert.IsTrue(sut.IsEmpty());
     sut = new Systemschein(new Systemfeld(1, 2, 3, 4, 5, 6));
     sut.reset();
     Assert.IsTrue(sut.IsEmpty());
 }
Exemplo n.º 3
0
        public void can_quick()
        {
            ISchein sut = new Normalschein();
            sut.quick();
            Assert.IsFalse(sut.Tippfelder.Any(x => x.IsEmpty()));

            sut = new Systemschein();
            sut.quick();
            sut.Tippfelder.Each(Console.WriteLine);
            Assert.IsFalse(sut.Tippfelder.Any(x => x.IsEmpty()));
        }
Exemplo n.º 4
0
        public void ctor()
        {
            sut = new Normalschein();
            Assert.IsTrue(sut.IsEmpty());
            Assert.AreEqual(12, sut.Tippfelder.Count);
            Assert.IsTrue(sut.Tippfelder.All(x => 6 == x.SID));

            sut = new Systemschein();
            Assert.IsTrue(sut.IsEmpty());
            Assert.AreEqual(4, sut.Tippfelder.Count);
            Assert.IsTrue(sut.Tippfelder.All(x => 0 == x.SID));
        }
Exemplo n.º 5
0
        public void Tippfelder_should_be_populated()
        {
            sut = new Normalschein();
            Assert.That(sut.IsValid(), Is.False);
            X.printValidationErros(sut);

            sut = new Systemschein();
            Assert.That(sut.IsValid(), Is.False);
            X.printValidationErros(sut);
        }
Exemplo n.º 6
0
 public void on_Losnummer_StringEmpty()
 {
     sut = new Normalschein() { Losnummer = "" };
     sut.IsValid();
 }
Exemplo n.º 7
0
 public void on_Losnummer_null()
 {
     sut = new Normalschein() { Losnummer = null };
     sut.IsValid();
 }
Exemplo n.º 8
0
 public void on_Losnummer_is_6_numerics()
 {
     sut = new Normalschein { Losnummer = "123456"};
     sut.IsValid();
 }
Exemplo n.º 9
0
 public void on_Losnummer_contains_literal()
 {
     sut = new Normalschein() { Losnummer = "123456s" };
     sut.IsValid();
 }
Exemplo n.º 10
0
        public void Tippfelder_should_be_valid()
        {
            sut = new Systemschein(new Systemfeld(1, 2, 3) { SID = 25 });
            X.printValidationErros(sut);

            sut = new Systemschein(new Systemfeld(1, 2, 3));
            X.printValidationErros(sut);
        }
Exemplo n.º 11
0
 public void addSchein(ISchein schein )
 {
     schein.Parent = this;
     Scheine.Add(schein);
 }
Exemplo n.º 12
0
 // Indexierung =: IPositionedTipp.Position !!!
 public static ITippfeld toTippfeld(this IIndexedTipp tipp, ISchein schein)
 {
     var tippfeld = (tipp.Tipp is Tipp)
        ? new Normalfeld(tipp.Tipp.Tippzahlen.ToArray())
        : new Systemfeld(tipp.Tipp.Tippzahlen.ToArray()) { SID = tipp.Tipp.SID } as ITippfeld;
     schein.Tippfelder[tipp.Idx].SID = tipp.Tipp.SID;
     tipp.Tipp.Tippzahlen.Each(x => schein.Tippfelder[tipp.Idx].Tippzahlen.AddOrRemove(x));
     return tippfeld;
 }