コード例 #1
0
        public void InexistentEntity_Exists_ReturnsFalse()
        {
            var dbContext = new DestinationDbContext(_dstConnection);
            {
                var dstEntity = new DestinationUser
                {
                    EmailAddress   = "*****@*****.**",
                    SamAccountName = "pesho"
                };

                Assert.That(dbContext.EntityExists(dstEntity), Is.False);
            }
        }
コード例 #2
0
        public void RealEntity_Exists_ReturnsTrue()
        {
            var dbContext = new DestinationDbContext(_dstConnection);
            {
                var dstEntity = new DestinationUser
                {
                    EmailAddress   = "*****@*****.**",
                    SamAccountName = "pesho"
                };

                dbContext.Add(dstEntity);
                dbContext.SaveChanges();

                Assert.That(dbContext.EntityExists(dstEntity), Is.True);
            }
        }