コード例 #1
0
        public void IsContactConsistent_ReturnsTrue_IfRepositoryOwnerIsSetAndContactOwnerIsNotSet()
        {
            var repository = new PhoneBookRepository(_soundexFilter)
            {
                ConnectionString = _connectionString
            };
            repository.SetOwnerGuid(_guid);

            var newContact = new Contact();
            var result = repository.IsContactConsistent(newContact);

            Assert.True(result);
        }
コード例 #2
0
        public void IsContactConsistent_ReturnsFalse_IfRepositoryOwnerAndContactOwnerAreNotConsistent()
        {
            var repository = new PhoneBookRepository(_soundexFilter)
            {
                ConnectionString = _connectionString
            };
            repository.SetOwnerGuid(_guid);

            var newContact = new Contact() {Owner = Guid.NewGuid()};
            var result = repository.IsContactConsistent(newContact);

            Assert.False(result);
        }