public MatchResult DeclareResult(string name, Guid matchId, List<int> setResults) { var result = new MatchResult() { Id = Guid.NewGuid(), Name = name, MatchId = matchId, SetResults = setResults, }; _persistentService.Saveobject(result, "matchResult.json"); return result; }
public void DeclareResult_CheckArguments_Result() { _expectedresult = new MatchResult() { Name = "", MatchId = _matchid, SetResults = null }; var actual = _target.DeclareResult("", _matchid, null); Assert.AreEqual(_expectedresult.Name, actual.Name); Assert.AreEqual(_expectedresult.MatchId, actual.MatchId); Assert.AreEqual(_expectedresult.SetResults, actual.SetResults); }
private bool CheckResult(MatchResult actualresult, MatchResult expectedresult) { Assert.AreEqual(expectedresult.Name, actualresult.Name); Assert.AreEqual(expectedresult.MatchId, actualresult.MatchId); Assert.AreEqual(expectedresult.SetResults, actualresult.SetResults); return true; }
public void DeclareResult_CallSavefunction_Result() { _expectedresult = new MatchResult() { Name = "", MatchId = _matchid, SetResults = null }; _target.DeclareResult("",_matchid, null); _stubPersistentService.AssertWasCalled(x => x. Saveobject(Arg<MatchResult>.Matches(actualresult => CheckResult(actualresult, _expectedresult)), Arg<string>.Is.Same("matchResult.json"))); }