Git Product home page Git Product logo

web_api_tests's Introduction

Web-API tests

List<RSS> rssList = new()
{
    new RSS { Title = "1 feed", Content = "Description of the 1 feed", Link = url, Id = 1, Created = DateTime.Now, IsRead = false },
    new RSS { Title = "2 feed", Content = "Description of the 2 feed", Link = url, Id = 2, Created = DateTime.Now.AddDays(-1), IsRead = false },
    new RSS { Title = "3 feed", Content = "Description of the 3 feed", Link = url, Id = 3, Created = DateTime.Now.AddDays(-2), IsRead = false },
    new RSS { Title = "4 feed", Content = "Description of the 4 feed", Link = url, Id = 4, Created = DateTime.Now.AddDays(-3), IsRead = false }
};

List<User> userList = new()
{
    new User { Id = 1, Login = "FirstUser", Password = "qwe" },
    new User { Id = 2, Login = "SecondUser", Password = "asd" }
};

Many-to-many:

modelBuilder.Entity<User>()
    .HasMany(p => p.RSSList)
    .WithMany(p => p.Users)
    .UsingEntity(j => 
        j.HasData(
            new { UsersId = 1, RSSListId = 1 },
            new { UsersId = 1, RSSListId = 2 },
            new { UsersId = 1, RSSListId = 3 },
            new { UsersId = 1, RSSListId = 4 },
            new { UsersId = 2, RSSListId = 1 },
            new { UsersId = 2, RSSListId = 2 },
            new { UsersId = 2, RSSListId = 3 },
            new { UsersId = 2, RSSListId = 4 }
));
SetRssAsRead
  Приймає link.
  Link не є обов'язковим.
  При його відсутності всі RSS юзера становляться IsRead = false;
GetUnreadRSSWithDate
  Приймає date, addDays.
  Date можна залишити по замовчуванню.
  addDays змінює дату на необхідну кільіксть днів: може бути позитивним та негативним.
AddRss
  Приймає link.
  Інші поля моделі задаються по замовчуванню.
  Додається тільки для авторизованого юзера.

web_api_tests's People

Contributors

mykyta-rusyn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.