Example #1
0
        public void Can_Perform_Add_On_UserGroupRepository()
        {
            // Arrange
            IScopeProvider provider = ScopeProvider;

            using (IScope scope = provider.CreateScope())
            {
                UserGroupRepository repository = CreateRepository(provider);

                UserGroup userGroup = UserGroupBuilder.CreateUserGroup();

                // Act
                repository.Save(userGroup);
                scope.Complete();

                // Assert
                Assert.That(userGroup.HasIdentity, Is.True);
            }
        }
Example #2
0
        public void Can_Verify_Fresh_Entity_Is_Not_Dirty()
        {
            // Arrange
            IScopeProvider provider = ScopeProvider;

            using (IScope scope = provider.CreateScope())
            {
                UserGroupRepository repository = CreateRepository(provider);

                UserGroup userGroup = UserGroupBuilder.CreateUserGroup();
                repository.Save(userGroup);
                scope.Complete();

                // Act
                IUserGroup resolved = repository.Get((int)userGroup.Id);
                bool       dirty    = ((UserGroup)resolved).IsDirty();

                // Assert
                Assert.That(dirty, Is.False);
            }
        }