Пример #1
0
        public HttpResponseMessage Create([FromBody]  SimpleTeamModel team)
        {
            TeamLogic teamLogic = new TeamLogic();

            jsonResult = teamLogic.Create(team);

            returnResult.Content = new StringContent(jsonResult, Encoding.UTF8, "application/json");
            return(returnResult);
        }
Пример #2
0
        public void TeamLogic()
        {
            Mock <IUnitOfWork>     uow  = new Mock <IUnitOfWork>();
            Mock <ITeamRepository> repo = new Mock <ITeamRepository>();

            TeamLogic logic = new TeamLogic(uow.Object, repo.Object);

            var team     = new Team();
            var sequence = new MockSequence();

            repo.InSequence(sequence).Setup(r => r.Create(team));
            repo.InSequence(sequence).Setup(r => r.Update(team));
            repo.InSequence(sequence).Setup(r => r.Get(team.Id));
            logic.Create(team);
            logic.Update(team);
            logic.Get(team.Id);
        }