コード例 #1
0
        public void FindUser_ByUseNAme_DoesNotFindUser()
        {
            var repository = new DapperRepository();

            repository.Insert(new User {
                UserName = _validUserName
            });

            var query = new FindUserQueryDapper();

            var result = query.Execute(_invalidUserName);

            Assert.That(result, Is.Null);
        }
コード例 #2
0
        public void FindUser_ByUserName_FindsUser()
        {
            var repository = new DapperRepository();

            var id = repository.Insert(new User {
                UserName = _validUserName
            });

            var query = new FindUserQueryDapper();

            var result = query.Execute(_validUserName);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Id, Is.EqualTo(id));
            Assert.That(result.UserName, Is.EqualTo(_validUserName));
        }