JCoder.Mock4Net 2.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package JCoder.Mock4Net --version 2.5.1                
NuGet\Install-Package JCoder.Mock4Net -Version 2.5.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JCoder.Mock4Net" Version="2.5.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JCoder.Mock4Net --version 2.5.1                
#r "nuget: JCoder.Mock4Net, 2.5.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JCoder.Mock4Net as a Cake Addin
#addin nuget:?package=JCoder.Mock4Net&version=2.5.1

// Install JCoder.Mock4Net as a Cake Tool
#tool nuget:?package=JCoder.Mock4Net&version=2.5.1                

JCoder.Mock4Net

属性
作者(Authors) Jackie Law
版权(Copyright) Copyright © Jackie Law. All rights reserved.
协议 MIT
联系(QQ) 1378071853
联系(微信) JackieLaw1024
联系(Email) JackieLaw-dev@outlook.com

目录

[TOC]

介绍

  1. JCoder = Jackie who a coder.;
  2. C#库;
  3. A simple library for data mock.(一款简易版的用于模拟数据的功能库);
  4. AUpgrader version of JCore.Mock4Net.(JCore.Mock4Net的升级版。);

架构说明

.Net框架

.Net框架 .Net项目类型
.Net Standard 2.1 -
.Net Framework 4.5.2 -
.Net 5 -
.Net 6 -

引用类库

引用类库 版本
- -

相关类库

相关类库 说明
JCore.Mock4Net 一款简易版的用于模拟数据的功能库。JCoder.Mock4Net的旧版本
JCoder.Mock4Net 一款简易版的用于模拟数据的功能库。

获取方式

  1. 版本要求:>=2.3.2
  2. 以版本2.3.2为例
获取方式 描述
Package Manager Install-Package JCoder.Mock4Net -Version 2.3.2
.Net CLI dotnet add package JCoder.Mock4Net --version 2.3.2
PackageReference, <PackageReference Include="JCoder.Mock4Net" Version="2.3.2" />
Paket CLI paket add JCoder.Mock4Net --version 2.3.2
Script&Interactive #r "nuget: JCoder.Mock4Net, 2.3.2"
Cake // Install JCoder.Mock4Net as a Cake Addin<br/>#addin nuget:?package=JCoder.Mock4Net&version=2.3.2<br/><br/>// Install JCoder.Mock4Net as a Cake Tool<br/>#tool nuget:?package=JCoder.Mock4Net&version=2.3.2

使用说明

生成随机值

  1. 生成随机数

   // 生成Int32,闭区间范围
   Mock.GenInt(-10, 10);
   // -10 To 10

   // 生成Int32,右开区间
   Mock.GenIntWithRightOpen(-10, 10);
   // -10 To 9

   // 生成Int32,全开区间
   Mock.GenIntWithOpen(-10, 10);
   // -9 To 9
   
   // 生成double,闭区间范围
   Mock.GenDouble(-10.0, 10.0);
   // 3.1568602379730253

   // 生成double(指定精度),闭区间范围
   Mock.GenDouble(-10.0, 10.0, 4);
   // 5.0024

  1. 生成随机文本

   var _source = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-=!@#$%^&*()_+";
   
   // 生成10位长度随机组合的文本
   Mock.GenText(_source, 10);
   // dhC8EoP7pd
   
   // 生成15位长度不重复的随机组合的文本
   Mock.GenTextNoRepeat(_source, 15);
   // 1yADU3OhfCNY*PW
   
   // 生成15位长度以A-Za-z随机组合的文本
   Mock.GenTextEN(15);
   // RenoFLCfSWEzUYY
   
   // 生成15位长度以A-Z随机组合的文本
   Mock.GenTextEN(15);
   // INJXTSMQTURTJPI
   
   // 生成15位长度以a-z随机组合的文本
   Mock.GenTextEN(15);
   // fptxrwsrskfpkss
   
   // 生成15位长度以0-9随机组合的文本
   Mock.GenTextNumber(15);
   // 619582770751506
   
   // 生成15位长度以16进制随机组合的文本
   Mock.GenTextHex(15);
   // 9111EA7917548FE
   
   // 生成20位长度随机组合的中文文本
   Mock.GenChineses(20);
   // 凳榔贞奋锥泞呆酷霜这蛙种烈姿嫉轿蓖瞪赏纺
   
   // 生成随机中文
   Mock.GenChinese();
   // 舟
   
   
  1. 生成随机电话号码

   // 生成以136开头的11位长度电话号码
   Mock.GenPhoneNumber(11, 136);
   // 13623010509

  1. 生成随机国家或地区编码

   // 生成国家或地区的2位字母代码
   Mock.GenTerritoryCode2();
   // CH
   
   // 生成国家或地区的3位字母代码
   Mock.GenTerritoryCode3();
   // USA
   
   // 生成国家或地区的3位数字代码
   Mock.GenTerritoryNumber();
   // 583
   
   // 生成国家或地区的中文名称
   Mock.GenTerritoryCN();
   // 中国澳门

   // 生成国家或地区的英文名称
   Mock.GenTerritoryEN();
   // Yemen

  1. 生成随机名称

   // 生成中文名称
   Mock.GenFullNameCN();
   // 李小明
   
   // 生成中文名称(单姓氏+双字名称)
   Mock.GenFullNameCN(1,2);
   // 李小明
   
   // 生成中文名称(复姓氏+单字名称)
   Mock.GenFullNameCN(2,1);
   // 欧阳空
   
   // 生成英文名称
   Mock.GenFullNameEN();
   // Seteyski Steau
   
   // 生成英文名称(单姓+不限定长度)
   Mock.GenFullNameEN(1, -1);
   // Seadaez Smouski Sheethu
   

实例使用

  1. 参考JCoder.Mock4Net
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.8.2309.2801 258 9/27/2023
2.7.2308.315 182 8/3/2023
2.6.2 329 1/4/2023
2.6.1 280 12/12/2022
2.5.1 443 3/31/2022
2.4.1 406 3/19/2022
2.3.2 434 3/14/2022

Please contact Jackie by QQ 1378071853 or E-mail JackieLaw-dev@outlook.com;