Exemplo n.º 1
0
        public void TestToString()
        {
            LMPlayer player = new LMPlayer {
                Name = "andoni", LastName = "morales", Number = 1
            };

            Assert.AreEqual("1-andoni morales", player.ToString());
            player.NickName = "ylatuya";
            Assert.AreEqual("1-ylatuya", player.ToString());
        }
Exemplo n.º 2
0
        public static void RenderPlayer(LMPlayer player, int count, bool isExpanded, IDrawingToolkit tk,
                                        IContext context, Area backgroundArea, Area cellArea)
        {
            Point  image, text;
            double textWidth;

            image = new Point(StyleConf.ListTextOffset, cellArea.Start.Y);
            text  = new Point(image.X + StyleConf.ListRowSeparator + StyleConf.ListImageWidth,
                              cellArea.Start.Y);
            textWidth = cellArea.Start.X + cellArea.Width - text.X;

            tk.Context = context;
            tk.Begin();
            RenderBackgroundAndText(isExpanded, tk, backgroundArea, text, textWidth, player.ToString());
            /* Photo */
            RenderPlayer(tk, player, image);
            RenderCount(isExpanded, player.Color, count, tk, backgroundArea, cellArea);
            RenderSeparationLine(tk, context, backgroundArea);
            tk.End();
        }
Exemplo n.º 3
0
        public void TestPlayer()
        {
            LMPlayer player1 = new LMPlayer {
                Name        = "andoni", Position = "runner",
                Number      = 5, Birthday = new DateTime(1984, 6, 11),
                Nationality = "spanish", Height = 1.73f, Weight = 70,
                Playing     = true, Mail = "test@test", Color = Color.Red
            };

            player1.Photo = Utils.LoadImageFromFile();
            storage.Store(player1);
            Assert.AreEqual(2, db.DocumentCount);
            Assert.IsNotNull(db.GetExistingDocument(player1.ID.ToString()));
            LMPlayer player2 = storage.Retrieve <LMPlayer> (player1.ID);

            Assert.AreEqual(player1.ID, player2.ID);
            Assert.AreEqual(player1.ToString(), player2.ToString());
            Assert.AreEqual(player1.Photo.Width, player2.Photo.Width);
            Assert.IsNotNull(player2.DocumentID);
            storage.Delete(player1);
            Assert.AreEqual(1, db.DocumentCount);
        }