Example #1
0
 public ProfileControllerTests(ProfileFixture fixture)
 {
     _controller = fixture.Scope.ServiceProvider.GetService <ProfileController>();
     _dao        = fixture.Scope.ServiceProvider.GetService <IProfileDao>();
     _attribute  = fixture.Attribute;
     _profile    = fixture.Profile;
 }
Example #2
0
 public Task CreateProfile(YobaProfile p, CancellationToken cancel = default)
 {
     using var db = _factory.Create();
     return(db.Profiles.InsertAsync(() => new Profile
     {
         Id = p.Id,
         Loisy = p.Loisy,
         Slivi = p.Slivi,
         Zashkvory = p.Zashkvory,
         CanVote = p.CanVote,
         MainName = p.MainName,
         IsTransport = false,
     }, cancel));
 }
Example #3
0
 public ProfileDaoTests(ProfileFixture fixture)
 {
     _dao       = fixture.Scope.ServiceProvider.GetService <IProfileDao>();
     _attribute = fixture.Attribute;
     _profile   = fixture.Profile;
 }
Example #4
0
            static double karma(YobaProfile p)
            {
                var k = Math.Sqrt(Math.Pow(p.Loisy, 2) + Math.Pow(p.Zashkvory, 2)) / 100500.0;

                return(k * (p.Loisy - Math.Sqrt(0.93 * Math.Pow(p.Zashkvory, 2))));
            }