engine_web-ifc
engine_web-ifc copied to clipboard
Automated Test Suite #110
Commands :
- npm run test:unit
- npm run test:functional
- npm run test
Output from console

Which line... this bit?
storey.LongName.value = newStoreyName;
ifcApi.WriteLine(modelId, storey);
storey = await ifcApi.properties.getItemProperties(modelId, storeyId);
expect(storey.LongName.value).toBe(newStoreyName);
I think the caller's perspective is that writing the value to tape shouldn't affect the local property's value, and should also be equal after round-tripping.
That's what I didn't see asserted in your tests, but yeah, maybe we're missing each other's perspective :)
On Mon, Oct 17, 2022 at 2:20 AM TxTony @.***> wrote:
@.**** commented on this pull request.
In tests/functional/WebIfcApi.spec.ts https://github.com/IFCjs/web-ifc/pull/233#discussion_r996691765:
CompositionType: undefined,
PredefinedType: undefined,ElevationWithFlooring: undefined}ifcApi.WriteLine(modelID, payload);let projectAfterWriting: any = ifcApi.GetAllLines(modelID);expect(projectBeforeWriting.size() + 1).toEqual(projectAfterWriting.size());- })
- test('can modify a line by giving a line object', () => {
let aSpace: any = ifcApi.GetLine(modelID, expressId);aSpace.Name.value = "foo";ifcApi.WriteLine(modelID, aSpace);let aSpaceReloaded: any = ifcApi.GetLine(modelID, expressId);expect(aSpaceReloaded.Name.value).toEqual("foo");- })
- test('can Export File As IFC', () => {
Hi Pablo, All the methods are already tested so you can use them in any way. A WriteFile on web-ifc 0.0.36 fails so any scenario depending on writeFile will fail with this version. I don't think it is necessary at this point to make complexe scenario, except for documentation :) and documentation with test is the smart way.
However something is interresting with your test your tring to writeFile on a getItemProperties() result.
Maybe i am missing something what do you think ?
— Reply to this email directly, view it on GitHub https://github.com/IFCjs/web-ifc/pull/233#discussion_r996691765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS5V3ZBHOINYWFLVMGXGH3WDT45DANCNFSM6AAAAAARF2TYDY . You are receiving this because you commented.Message ID: @.***>
-- interweb homepage http://sites.google.com/site/pablomayrgundter
Which line... this bit?
storey.LongName.value = newStoreyName; ifcApi.WriteLine(modelId, storey); storey = await ifcApi.properties.getItemProperties(modelId, storeyId); expect(storey.LongName.value).toBe(newStoreyName);I think the caller's perspective is that writing the value to tape shouldn't affect the local property's value, and should also be equal after round-tripping. That's what I didn't see asserted in your tests, but yeah, maybe we're missing each other's perspective :) … On Mon, Oct 17, 2022 at 2:20 AM TxTony @.> wrote: @.* commented on this pull request. ------------------------------ In tests/functional/WebIfcApi.spec.ts <#233 (comment)>: > + CompositionType: undefined, + PredefinedType: undefined, + ElevationWithFlooring: undefined + } + ifcApi.WriteLine(modelID, payload); + let projectAfterWriting: any = ifcApi.GetAllLines(modelID); + expect(projectBeforeWriting.size() + 1).toEqual(projectAfterWriting.size()); + }) + test('can modify a line by giving a line object', () => { + let aSpace: any = ifcApi.GetLine(modelID, expressId); + aSpace.Name.value = "foo"; + ifcApi.WriteLine(modelID, aSpace); + let aSpaceReloaded: any = ifcApi.GetLine(modelID, expressId); + expect(aSpaceReloaded.Name.value).toEqual("foo"); + }) + test('can Export File As IFC', () => { Hi Pablo, All the methods are already tested so you can use them in any way. A WriteFile on web-ifc 0.0.36 fails so any scenario depending on writeFile will fail with this version. I don't think it is necessary at this point to make complexe scenario, except for documentation :) and documentation with test is the smart way. However something is interresting with your test your tring to writeFile on a getItemProperties() result. Maybe i am missing something what do you think ? — Reply to this email directly, view it on GitHub <#233 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS5V3ZBHOINYWFLVMGXGH3WDT45DANCNFSM6AAAAAARF2TYDY . You are receiving this because you commented.Message ID: @.***> -- interweb homepage http://sites.google.com/site/pablomayrgundter
Ok i Can add your test. I'll do it After @agviegas valid this PR ( or not ;) )
Hey, there are some conflicts. Solve them and I'll merge! Thanks 🙂
Tony go ahead and submit without my test. I can add it later
okay @agviegas it is done, i have add pablo's test case.
Looks good to me!