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; }
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"))); }
private bool CheckTeam(Team expected, Team actual) { Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(expected.League, actual.League); return true; }
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); }