public HomeController(ILogger <HomeController> logger, MockTestContext context, IQuestionRepository questionRepository, IScoreRepository scoreRepository)
 {
     _logger             = logger;
     _context            = context;
     _QuestionRepository = questionRepository;
     _ScoreRepository    = scoreRepository;
 }
        public async Task FindFirstOrDefaultByNameAsync()
        {
            var name = _clientPerson.Name;
            var id   = _serverPerson.Id;

            _serviceMock.Setup(capability =>
                               capability.PersonService.FindFirstOrDefaultByNameAsync(It.Is <string>(s => s == name),
                                                                                      CancellationToken.None)).ReturnsAsync(_serverPerson);
            var person = await _serverTranslator.FindFirstOrDefaultByNameAsync(_clientPerson.Name);

            var translator = new Translator(MockTestContext.GetServerName(), _translationServiceMock);

            Assert.AreEqual(translator.Decorate("person.id", id), person.Id);
            _serviceMock.Verify();
        }
        public void Initialize()
        {
            _translationServiceMock = new TranslatorServiceMock(MockTestContext.GetClientName(), true);
            _serviceMock            = new Mock <IGdprCapability>();
            _serverTranslator       = new PersonServerTranslatorFrom(_serviceMock.Object, MockTestContext.GetServerName);
            var name      = "Kalle Anka";
            var addresses = new Address[] { };
            var etag      = Guid.NewGuid().ToString();

            _clientPerson = new Person
            {
                Id        = $"{MockTestContext.GetClientName()}-1",
                Name      = name,
                Addresses = addresses,
                Etag      = etag
            };
            _serverPerson = new Person
            {
                Id        = $"1",
                Name      = name,
                Addresses = addresses,
                Etag      = etag
            };
        }
 public QuestionsController(MockTestContext context, IQuestionRepository questionRepository, IScoreRepository scoreRepository)
 {
     _context            = context;
     _QuestionRepository = questionRepository;
     _ScoreRepository    = scoreRepository;
 }
 public QuestionRepository(MockTestContext context)
 {
     _context = context;
 }
 public ScoreRepository(MockTestContext context)
 {
     _context = context;
 }