Skip to content

moaz-mokhtar/mock-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock Generator

Objective

This is to illustrate a functionality which I'm using in my Rust code to generating objects for structs to be able to use them for testing or other reason. This is to minimize developer's efforts to create objects to test.

Plan

  • Develep a basic illustration for the mock generator.
  • Develop test cases which illustrates the benefits of mock_generator.

Design

struct Object {
    pub id: usize,
    pub name: String,
    pub index: i32,
}

impl Object {
    pub fn mock(&self) -> Object {
        // Generate a mock for object which each field will be randomized based on type.
    }

    pub fn mocks(&self, count: i32) -> (Vec<Object>, Duration) {
        // Generate a list of mocks for Object which each field will be randomized based on type.
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages