
#![allow(dead_code)]
#[cfg(test)]

mod entity_tests {
    use crate::foundation::core::entity_repository::EntityRepository;

    #[test]
    fn entities_are_zero_at_first() {
        let entity_repository = EntityRepository::new(5000);
        assert_eq!(entity_repository.entity_count(), 0);
    }

    #[test]
    fn create_and_delete_entities() {
        let mut entity_repository = EntityRepository::new(5000);
        assert_eq!(entity_repository.create_entity(), 0);
        assert_eq!(entity_repository.create_entity(), 1);
        assert_eq!(entity_repository.create_entity(), 2);
        assert_eq!(entity_repository.entity_count(), 3);
        entity_repository.delete_entity(1);
        assert_eq!(entity_repository.entity_count(), 2);
        assert_eq!(entity_repository.entity_capacity(), 3);
        assert_eq!(entity_repository.create_entity(), 1);
        assert_eq!(entity_repository.entity_count(), 3);

        assert_eq!(entity_repository.entity_version(0), 1);
        assert_eq!(entity_repository.entity_version(1), 2);
        assert_eq!(entity_repository.entity_version(2), 1);

        let entity = entity_repository.entity_object(1);
        assert_eq!(entity.entity_rid(), 1);
        assert_eq!(entity.entity_version(), 2);

    }

}
