Beispiel #1
0
        public Team DeclareTeam(string name, int league)
        {
            var team = new Team()
            {
                Id = Guid.NewGuid(),
                Name = name,
                League = league,
                Date = DateTime.Now
            };

            _persistentService.Saveobject(team, "team.json");

            return team;
        }
Beispiel #2
0
        public void DeclareTeam_Saveobject_Team()
        {
            var expectedTeam = new Team
            {
                Name = "",
                League = 0,

            };
            _target.DeclareTeam("", 0);

            _stubPersistentService.AssertWasCalled(x => x
                .Saveobject(Arg<Team>.Matches(actualTeam => CheckTeam(expectedTeam, actualTeam)),
                    Arg<string>.Is.Same("team.json")));
        }
Beispiel #3
0
        private bool CheckTeam(Team expected, Team actual)
        {
            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.League, actual.League);

            return true;
        }
Beispiel #4
0
        public void DeclareTeam_CheckArguments_Team()
        {
            var expectedTeam = new Team
            {
                Name = "",
                League = 0,

            };
            var actual = _target.DeclareTeam("", 0);

            Assert.AreEqual(expectedTeam.Name, actual.Name);
            Assert.AreEqual(expectedTeam.League, actual.League);
        }