Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75570024
basic_datatype.spec.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 3, 00:56
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Aug 5, 00:56 (2 d)
Engine
blob
Format
Raw Data
Handle
19569359
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
basic_datatype.spec.ts
View Options
import { Component, Input, DebugElement, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { BasicResultBindingElement, FusekiResults} from './basic_datatype';
const data = {'iri': 'asdf'};
const validData: FusekiResults = { 'head': { 'vars': [ 'id' ] }, 'results': { 'bindings': null }}
class A {
class: string = 'A';
static do<T extends typeof A>(this: T): InstanceType<T> {
return new this() as InstanceType<T>;
}
}
class B extends A {
class: string = 'B';
}
describe('BasicResultBindingElement', () => {
it('should create the Object', ()=>{
expect(new BasicResultBindingElement(data)).toBeTruthy();
});
it('should return its query if there is not input', ()=>{
expect(BasicResultBindingElement.getQuery()).toEqual(`SELECT ?id ?p ?o WHERE { ?id ?p ?o. }`);
});
it('should return a subject changed query', ()=>{
expect(BasicResultBindingElement.getQuery('http://example.com#test')).toEqual(`SELECT ?id ?p ?o WHERE { <http://example.com#test> ?p ?o. }`);
});
it('should return a object changed query', ()=>{
expect(BasicResultBindingElement.getQuery('http://example.com#test', 'o')).toEqual(`SELECT ?id ?p ?o WHERE { ?id ?p <http://example.com#test>. }`);
});
it('should return a predicate changed query', ()=>{
expect(BasicResultBindingElement.getQuery('http://example.com#test', 'p')).toEqual(`SELECT ?id ?p ?o WHERE { ?id <http://example.com#test> ?o. }`);
});
it('should return subclass', ()=>{
expect(B.do().class == "B").toBeTruthy();
});
});
Event Timeline
Log In to Comment