예제 #1
0
        public Match DeclareMatch(string name, string place)
        {
            var match = new Match()
            {
                Id = Guid.NewGuid(),
                Name = name,
                Place = place,
                Date = DateTime.Now
            };

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

            return match;
        }
예제 #2
0
        private Match CreateMatch()
        {
            var match= new Match()
            { Place = "h",
             Date = _date,
             Id = _id,
             Name = "ha"};

            return match;
        }
예제 #3
0
        public void DeclareMatch_CheckArguments_Match()
        {
            _expectedMatch = new Match()
            {
                Place = "",
                Name = "",
            };

            var actual = _target.DeclareMatch(
                _expectedMatch.Place, _expectedMatch.Name);

            Assert.AreEqual(_expectedMatch.Place, actual.Place);
            Assert.AreEqual(_expectedMatch.Name, actual.Name);
        }
예제 #4
0
        public void DeclareMatch_Saveobject_Match()
        {
            _expectedMatch = new Match()
            {
                Place = "",
                Name = ""
            };

            _target.DeclareMatch(_expectedMatch.Place, _expectedMatch.Name);

            _stubPersistentService.AssertWasCalled(x => x
                .Saveobject(Arg<Match>.Matches(actualMatch => CheckMatch(_expectedMatch, actualMatch)),
                    Arg<string>.Is.Same("match.json")));
        }
예제 #5
0
        private bool CheckMatch(Match expectedMatch, Match actualMatch)
        {
            Assert.AreEqual(expectedMatch.Place, actualMatch.Place);
            Assert.AreEqual(expectedMatch.Name, actualMatch.Name);

            return true;
        }