Exemplo n.º 1
0
        public void CreateEntityAudit_WithEntity_Succeeds()
        {
            var permission = CreateTestPermission();

            var evt = new EntityAuditEvent <Permission>(EventTypes.EntityCreatedEvent, permission.Id.ToString(), permission);

            AssertBaseEntity(permission, evt);
            Assert.Equal(permission.Id, evt.Entity.Id);
        }
Exemplo n.º 2
0
        public void CreateEntityAudit_WithoutPermission_Succeeds()
        {
            var permission = CreateTestPermission();

            var evt = new EntityAuditEvent <Permission>(EventTypes.EntityCreatedEvent, permission.Id.ToString());

            AssertBaseEntity(permission, evt);
            Assert.Null(evt.Entity);
        }
Exemplo n.º 3
0
 AuditKey GetKey(EntityAuditEvent <TestInstance> e)
 {
     return(new AuditKey
     {
         TestInstanceId = e.Entity.Id,
         SessionId = e.SessionId,
         Timestamp = e.Timestamp,
     });
 }
Exemplo n.º 4
0
 private void AssertBaseEntity(Permission permission, EntityAuditEvent <Permission> evt)
 {
     Assert.Equal(permission.Id.ToString(), evt.EntityId);
     Assert.Equal(permission.GetType().FullName, evt.EntityType);
 }