Example #1
0
        public void TestCreateDefaultTemplate()
        {
            LMTeam t = LMTeam.DefaultTemplate(10);

            Assert.AreEqual(t.Players.Count, 10);
            t.AddDefaultItem(8);
            Assert.AreEqual(t.Players.Count, 11);
        }
Example #2
0
        public void TestCreateDefaultTemplate()
        {
            // Arrrange
            mockPreview.Setup(p => p.CreatePreview(It.IsAny <LMTeam> ())).Returns(new Image(1, 1));

            // Act
            LMTeam t = LMTeam.DefaultTemplate(10);

            // Assert
            Assert.IsNull(t.Shield);
            Assert.IsNotNull(t.Preview);
            Assert.AreEqual(t.Players.Count, 10);
            t.AddDefaultItem(8);
            Assert.AreEqual(t.Players.Count, 11);
        }
Example #3
0
        void HandleCreatePlayer(CreateEvent <LMPlayer> e)
        {
            LMTeam model    = teamEditor.Team.Model;
            var    player   = model.AddDefaultItem(model.List.Count);
            var    playerVM = teamEditor.Team.ViewModels.FirstOrDefault(p => p.Model == player);

            teamEditor.Team.Selection.Replace(new List <PlayerVM> {
                playerVM
            });
            foreach (var p in teamEditor.Team.ViewModels)
            {
                p.Tagged = false;
            }
            playerVM.Tagged = true;
            App.Current.EventsBroker.Publish(new UpdateLineup());
        }