예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
        }
예제 #4
0
        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")));
        }