當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript alsatian.Expect函數代碼示例

本文整理匯總了TypeScript中alsatian.Expect函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript Expect函數的具體用法?TypeScript Expect怎麽用?TypeScript Expect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Expect函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: claimToHexFailIfChangedAttribute

  @Test()
  @TestCase(TheRaven)
  public claimToHexFailIfChangedAttribute(work: Work) {
    // Changing any field should change the serialized too

    Expect(
      Serialization.claimToHex(
        editAttributes(work, {
          name: 'Nevermore',
        })
      )
    ).not.toBe(TheRavenHex)

    Expect(
      Serialization.claimToHex(
        editAttributes(work, {
          author: 'E.A.P.',
        })
      )
    ).not.toBe(TheRavenHex)

    Expect(
      Serialization.claimToHex(
        editAttributes(work, {
          dateCreated: new Date().toISOString(),
        })
      )
    ).not.toBe(TheRavenHex)
  }
開發者ID:aconly,項目名稱:poet-js,代碼行數:29,代碼來源:ClaimToHex.ts

示例2: mixerReturnsCorrectLength

 @Test()
 public mixerReturnsCorrectLength() {
   let mixer = new Mixer({secondsPerMix: 1}, {});
   let results = mixer.mix(44100);
   Expect(results.bufferSize).toBe(44100);
   Expect(results.output[0].length).toBe(44100); /* mixing is always in stereo */
   Expect(results.output[1].length).toBe(44100); /* mixing is always in stereo */
 }
開發者ID:gundy,項目名稱:jssynth,代碼行數:8,代碼來源:mixer.spec.ts

示例3: getWorksByPublicKeyShouldSucceed

  @AsyncTest()
  @TestCase(TheRaven.publicKey)
  @TestCase(TheMurdersInTheRueMorgue.publicKey)
  @TestCase(AStudyInScarlet.publicKey)
  async getWorksByPublicKeyShouldSucceed(publicKey: string) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:10,代碼來源:GetWorksByPublicKey.ts

示例4: postWorkShouldSucceedWith202

  @AsyncTest()
  async postWorkShouldSucceedWith202() {
    const claim = createClaim(Key1.privateKey, ClaimType.Work, {
      name: 'Name',
    })

    const postResponse = await this.client.postWork(claim)

    Expect(postResponse.ok).toBeTruthy()
    Expect(postResponse.status).toBe(202)
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:11,代碼來源:PostWork.ts

示例5: getWorksByACDPublicKeyShouldReturnOneElement

  @AsyncTest()
  @TestCase(AStudyInScarlet.publicKey)
  async getWorksByACDPublicKeyShouldReturnOneElement(publicKey: string) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const claims = await response.json()

    Expect(claims.length).toBe(1)
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:12,代碼來源:GetWorksByPublicKey.ts

示例6: getWorksByEAPPublicKeyShouldReturnTwoElements

  @AsyncTest()
  @TestCase(TheRaven.publicKey)
  async getWorksByEAPPublicKeyShouldReturnTwoElements(publicKey: string) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const claims = await response.json()

    Expect(claims.length).toBe(2)
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:12,代碼來源:GetWorksByPublicKey.ts

示例7: getWork404

  @AsyncTest()
  @TestCase('1234')
  async getWork404(id: string) {
    const response = await this.client.getWork(id)

    Expect(response.status).toBe(404)
    Expect(response.ok).not.toBeTruthy()

    const body = await response.text()

    Expect(body).toBe('')
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:12,代碼來源:GetWork.ts

示例8: getWork200

  @AsyncTest()
  @TestCase(TheRaven)
  @TestCase(TheMurdersInTheRueMorgue)
  @TestCase(AStudyInScarlet)
  async getWork200(claim: Claim) {
    const response = await this.client.getWork(claim.id)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const body = await response.json()

    Expect(body.id).toBe(claim.id)
    Expect(body.attributes.name).toBe(claim.attributes.name)
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:15,代碼來源:GetWork.ts

示例9: getWorksByPublicKeyShouldReturnClaimsMatchingPublicKey

  @AsyncTest()
  @TestCase(TheRaven.publicKey)
  @TestCase(TheMurdersInTheRueMorgue.publicKey)
  @TestCase(AStudyInScarlet.publicKey)
  async getWorksByPublicKeyShouldReturnClaimsMatchingPublicKey(publicKey: string) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const claims = await response.json()
    const allElementsMatchPublicKey = !claims.find((claim: Claim) => claim.publicKey !== publicKey)

    Expect(allElementsMatchPublicKey).toBeTruthy()
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:15,代碼來源:GetWorksByPublicKey.ts

示例10: getWorksByPublicKeyShouldReturnAnArray

  @AsyncTest()
  @TestCase(TheRaven.publicKey)
  @TestCase(TheMurdersInTheRueMorgue.publicKey)
  @TestCase(AStudyInScarlet.publicKey)
  async getWorksByPublicKeyShouldReturnAnArray(publicKey: string) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const claims = await response.json()

    Expect(claims).toBeDefined()
    Expect(Array.isArray(claims)).toBeTruthy()
  }
開發者ID:GuilhermeCaruso,項目名稱:node,代碼行數:15,代碼來源:GetWorksByPublicKey.ts


注:本文中的alsatian.Expect函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。