< Summary

Information
Class: MRA.Infrastructure.Database.Documents.MongoDb.DrawingMongoDocument
Assembly: MRA.Infrastructure
File(s): D:\a\MiguelRomerART\MiguelRomerART\MRA.Infrastructure\Database\Documents\MongoDb\DrawingMongoDocument.cs
Line coverage
80%
Covered lines: 29
Uncovered lines: 7
Coverable lines: 36
Total lines: 111
Line coverage: 80.5%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_path()100%11100%
get_path_thumbnail()100%11100%
get_type()100%11100%
get_visible()100%11100%
get_name()100%11100%
get_model_name()100%11100%
get_title()100%11100%
get_date()100%210%
get_drawingAt()100%11100%
get_time()100%11100%
get_product_type()100%11100%
get_product_name()100%11100%
get_list_comments()100%11100%
get_list_comments_style()100%11100%
get_list_comments_pros()100%11100%
get_list_comments_cons()100%11100%
get_views()100%11100%
get_filter()100%11100%
get_likes()100%11100%
get_favorite()100%11100%
get_reference_url()100%11100%
get_spotify_url()100%11100%
get_twitter_url()100%11100%
get_instagram_url()100%11100%
get_software()100%11100%
get_paper()100%11100%
get_tags()100%11100%
get_score_critic()100%11100%
get_score_popular()100%11100%
get_votes_popular()100%11100%
GetId()100%210%
SetDocumentAsync()100%210%

File(s)

D:\a\MiguelRomerART\MiguelRomerART\MRA.Infrastructure\Database\Documents\MongoDb\DrawingMongoDocument.cs

#LineLine coverage
 1using MongoDB.Bson.Serialization.Attributes;
 2using MongoDB.Driver;
 3using MRA.Infrastructure.Database.Documents.Interfaces;
 4using MRA.Infrastructure.Database.Providers;
 5
 6namespace MRA.Infrastructure.Database.Documents.MongoDb;
 7
 8public class DrawingMongoDocument : MongoDocumentBase, IDrawingDocument
 9{
 10    [BsonElement("path")]
 3711    public string path { get; set; }
 12
 13    [BsonElement("path_thumbnail")]
 3714    public string path_thumbnail { get; set; }
 15
 16    [BsonElement("type")]
 3717    public int type { get; set; }
 18
 19    [BsonElement("visible")]
 4320    public bool? visible { get; set; }
 21
 22    [BsonElement("name")]
 4923    public string name { get; set; }
 24
 25    [BsonElement("model_name")]
 4926    public string model_name { get; set; }
 27
 28    [BsonElement("title")]
 3729    public string title { get; set; }
 30
 31    [BsonElement("date")]
 032    public string date { get; set; }
 33
 34    [BsonElement("drawingAt")]
 3735    public DateTime drawingAt { get; set; }
 36
 37    [BsonElement("time")]
 3738    public int? time { get; set; }
 39
 40    [BsonElement("product_type")]
 4941    public int product_type { get; set; }
 42
 43    [BsonElement("product_name")]
 4944    public string product_name { get; set; }
 45
 46    [BsonElement("list_comments")]
 3747    public IEnumerable<string> list_comments { get; set; }
 48
 49    [BsonElement("list_comments_style")]
 3750    public IEnumerable<string> list_comments_style { get; set; }
 51
 52    [BsonElement("list_comments_pros")]
 3753    public IEnumerable<string> list_comments_pros { get; set; }
 54
 55    [BsonElement("list_comments_cons")]
 3756    public IEnumerable<string> list_comments_cons { get; set; }
 57
 58    [BsonElement("views")]
 3959    public long views { get; set; }
 60
 61    [BsonElement("filter")]
 3762    public int filter { get; set; }
 63
 64    [BsonElement("likes")]
 3965    public long likes { get; set; }
 66
 67    [BsonElement("favorite")]
 3768    public bool favorite { get; set; }
 69
 70    [BsonElement("reference_url")]
 3771    public string reference_url { get; set; }
 72
 73    [BsonElement("spotify_url")]
 3774    public string spotify_url { get; set; }
 75
 76    [BsonElement("twitter_url")]
 3777    public string twitter_url { get; set; }
 78
 79    [BsonElement("instagram_url")]
 3780    public string instagram_url { get; set; }
 81
 82    [BsonElement("software")]
 3783    public int software { get; set; }
 84
 85    [BsonElement("paper")]
 3786    public int paper { get; set; }
 87
 88    [BsonElement("tags")]
 3789    public IEnumerable<string>? tags { get; set; }
 90
 91    [BsonElement("score_critic")]
 3792    public int score_critic { get; set; }
 93
 94    [BsonElement("score_popular")]
 4095    public double score_popular { get; set; }
 96
 97    [BsonElement("votes_popular")]
 4198    public int votes_popular { get; set; }
 99
 0100    public string GetId() => Id;
 101
 102    public override async Task<ReplaceOneResult> SetDocumentAsync(IMongoDatabase database, string collection, string doc
 103    {
 0104        var mongoCollection = database.GetCollection<DrawingMongoDocument>(collection);
 105
 0106        var filter = Builders<DrawingMongoDocument>.Filter.Eq(MongoDbDatabase.ID_FIELD, documentId);
 0107        var options = new ReplaceOptions { IsUpsert = true };
 108
 0109        return await mongoCollection.ReplaceOneAsync(filter, this, options);
 0110    }
 111}