SAP Spartacus HttpParamsURIEncoder单元测试文件备份
发布日期:2021-06-30 14:32:46
浏览次数:2
分类:技术文章
本文共 1331 字,大约阅读时间需要 4 分钟。
import { HttpParamsURIEncoder } from "./http-params-uri.encoder";describe('HttpParamsURIEncoder', () => { const httpParamsURIEncoder = new HttpParamsURIEncoder(); const VALUE_FOR_ENCODE = 'Hello Spartacus!'; const VALUE_FOR_DECODE = 'Hello%20Spartacus!'; describe(`test for encodeKey`, () => { it('should equal to result of encodeURIComponent', () => { const result = httpParamsURIEncoder.encodeKey(VALUE_FOR_ENCODE) expect(result).toEqual(VALUE_FOR_DECODE); }); }); describe(`test for encodeValue`, () => { it('should equal to result of encodeURIComponent', () => { const result = httpParamsURIEncoder.encodeValue(VALUE_FOR_ENCODE) expect(result).toEqual(VALUE_FOR_DECODE); }); }); describe(`test for decodeKey`, () => { it('should equal to result of decodeURIComponent', () => { const result = httpParamsURIEncoder.decodeKey(VALUE_FOR_DECODE) expect(result).toEqual(VALUE_FOR_ENCODE); }); }); describe(`test for decodeValue`, () => { it('should equal to result of decodeURIComponent', () => { const result = httpParamsURIEncoder.decodeValue(VALUE_FOR_DECODE) expect(result).toEqual(VALUE_FOR_ENCODE); }); }); });
ng test结果:
转载地址:https://jerry.blog.csdn.net/article/details/108854347 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月12日 14时49分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
HDOJ2049 不容易系列之(4)——考新郎
2021-07-03
POJ-2418 Hardwood Species(Trie树)(map)
2021-07-03
UVA-11401 Triangle Counting(数学优化)
2021-07-03
Codeforces Round #369 (Div. 2)
2019-04-30
HDU-2838 Cow Sorting(树状数组)
2019-04-30
基于SSM的兼职论坛系统的设计与实现
2019-04-30
基于java的ssm框架就业信息管理系统的设计
2019-04-30
如何用同期群分析模型提升留存?(Tableau实战)
2019-04-30
2021最新 上海互联网公司排名
2019-04-30
Oracle字符串分隔符替换(替换奇数个或偶数个)
2019-04-30
Oracle 利用 UTL_SMTP 包发送邮件
2019-04-30
Oracle 的循环中的异常捕捉和处理
2019-04-30
Oracle的pfile和spfile的一点理解和笔记
2019-04-30
java实现稀疏数组及将稀疏数组存入硬盘中
2019-04-30
2021-05-18
2019-04-30
libuv实现ping包发送和接收
2019-04-30
基础架构系列篇-系统centos7安装docker+COMPOSE
2019-04-30
基础架构系列篇-NGINX部署VUE
2019-04-30
基础架构系列篇-系统centos7安装kafka
2019-04-30