<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using eFormSqlController;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;

namespace eFormSDK.Tests
{
    [TestFixture]
    public class TagginsUTest : DbTestFixture
    {
        [Test]
        public void Taggins_Create_DoesCreate()
        {
            Random rnd = new Random();
            
            short shortMinValue = Int16.MinValue;
            short shortmaxValue = Int16.MaxValue;
            
            bool randomBool = rnd.Next(0, 2) > 0;
            
            tags tag = new tags();
            tag.Name = Guid.NewGuid().ToString();
            tag.TaggingsCount = rnd.Next(1, 255);
            tag.Create(DbContext);
            
            check_lists checklist = new check_lists();
            checklist.Color = Guid.NewGuid().ToString();
            checklist.Custom = Guid.NewGuid().ToString();
            checklist.Description = Guid.NewGuid().ToString();
            checklist.Field1 = rnd.Next(1, 255);
            checklist.Field2 = rnd.Next(1, 255);
            checklist.Field3 = rnd.Next(1, 255);
            checklist.Field4 = rnd.Next(1, 255);
            checklist.Field5 = rnd.Next(1, 255);
            checklist.Field6 = rnd.Next(1, 255);
            checklist.Field7 = rnd.Next(1, 255);
            checklist.Field8 = rnd.Next(1, 255);
            checklist.Field9 = rnd.Next(1, 255);
            checklist.Field10 = rnd.Next(1, 255);
            checklist.Label = Guid.NewGuid().ToString();
            checklist.Repeated = rnd.Next(1, 255);
            checklist.ApprovalEnabled = (short)rnd.Next(shortMinValue, shortmaxValue);
            checklist.CaseType = Guid.NewGuid().ToString();
            checklist.DisplayIndex = rnd.Next(1, 255);
            checklist.DownloadEntities = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.FastNavigation = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.FolderName = Guid.NewGuid().ToString();
            checklist.ManualSync = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.MultiApproval = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.OriginalId = Guid.NewGuid().ToString();
            checklist.ParentId = rnd.Next(1, 255);
            checklist.ReviewEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.DocxExportEnabled = randomBool;
            checklist.DoneButtonEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.ExtraFieldsEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.JasperExportEnabled = randomBool;
            checklist.QuickSyncEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.Create(DbContext);
            
            taggings tagging = new taggings();
            tagging.Tag = tag;
            tagging.CheckList = checklist;
            tagging.TaggerId = rnd.Next(1, 255);
            tagging.TagId = rnd.Next(1, 255);
            tagging.CheckListId = checklist.Id;
            
            
            //Act
            
            tagging.Create(DbContext);

            taggings dbTagging = DbContext.taggings.AsNoTracking().First();
            List<taggings> taggingsList = DbContext.taggings.AsNoTracking().ToList();
            
            //Assert
            
            Assert.NotNull(dbTagging);                                                             
            Assert.NotNull(dbTagging.Id);                                                          

            Assert.AreEqual(1,taggingsList.Count());  
            
            Assert.AreEqual(tagging.CreatedAt.ToString(), dbTagging.CreatedAt.ToString());                                  
            Assert.AreEqual(tagging.Version, dbTagging.Version);                                      
            Assert.AreEqual(tagging.UpdatedAt.ToString(), dbTagging.UpdatedAt.ToString());                                  
            Assert.AreEqual(dbTagging.WorkflowState, eFormShared.Constants.WorkflowStates.Created);
            Assert.AreEqual(tagging.Id, dbTagging.Id);
            Assert.AreEqual(tagging.Tag, dbTagging.Tag);
            Assert.AreEqual(tagging.CheckList, dbTagging.CheckList);
            Assert.AreEqual(tagging.TaggerId, dbTagging.TaggerId);
            Assert.AreEqual(tagging.TagId, dbTagging.TagId);
            Assert.AreEqual(tagging.CheckListId, dbTagging.CheckListId);
            
        }
    }
}<commit_msg>Implementing first stage of UnitTest for taggins<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using eFormSqlController;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;

namespace eFormSDK.Tests
{
    [TestFixture]
    public class TagginsUTest : DbTestFixture
    {
        [Test]
        public void Taggins_Create_DoesCreate()
        {
            Random rnd = new Random();
            
            short shortMinValue = Int16.MinValue;
            short shortmaxValue = Int16.MaxValue;
            
            bool randomBool = rnd.Next(0, 2) > 0;
            
            tags tag = new tags();
            tag.Name = Guid.NewGuid().ToString();
            tag.TaggingsCount = rnd.Next(1, 255);
            tag.Create(DbContext);
            
            check_lists checklist = new check_lists();
            checklist.Color = Guid.NewGuid().ToString();
            checklist.Custom = Guid.NewGuid().ToString();
            checklist.Description = Guid.NewGuid().ToString();
            checklist.Field1 = rnd.Next(1, 255);
            checklist.Field2 = rnd.Next(1, 255);
            checklist.Field3 = rnd.Next(1, 255);
            checklist.Field4 = rnd.Next(1, 255);
            checklist.Field5 = rnd.Next(1, 255);
            checklist.Field6 = rnd.Next(1, 255);
            checklist.Field7 = rnd.Next(1, 255);
            checklist.Field8 = rnd.Next(1, 255);
            checklist.Field9 = rnd.Next(1, 255);
            checklist.Field10 = rnd.Next(1, 255);
            checklist.Label = Guid.NewGuid().ToString();
            checklist.Repeated = rnd.Next(1, 255);
            checklist.ApprovalEnabled = (short)rnd.Next(shortMinValue, shortmaxValue);
            checklist.CaseType = Guid.NewGuid().ToString();
            checklist.DisplayIndex = rnd.Next(1, 255);
            checklist.DownloadEntities = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.FastNavigation = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.FolderName = Guid.NewGuid().ToString();
            checklist.ManualSync = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.MultiApproval = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.OriginalId = Guid.NewGuid().ToString();
            checklist.ParentId = rnd.Next(1, 255);
            checklist.ReviewEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.DocxExportEnabled = randomBool;
            checklist.DoneButtonEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.ExtraFieldsEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.JasperExportEnabled = randomBool;
            checklist.QuickSyncEnabled = (short) rnd.Next(shortMinValue, shortmaxValue);
            checklist.Create(DbContext);
            
            taggings tagging = new taggings();
            tagging.Tag = tag;
            tagging.CheckList = checklist;
            tagging.TaggerId = rnd.Next(1, 255);
            tagging.TagId = rnd.Next(1, 255);
            tagging.CheckListId = checklist.Id;
            
            
            //Act
            
            tagging.Create(DbContext);

            taggings dbTagging = DbContext.taggings.AsNoTracking().First();
            List<taggings> taggingsList = DbContext.taggings.AsNoTracking().ToList();
            
            //Assert
            
            Assert.NotNull(dbTagging);                                                             
            Assert.NotNull(dbTagging.Id);                                                          

            Assert.AreEqual(1,taggingsList.Count());  
            
            Assert.AreEqual(tagging.CreatedAt.ToString(), dbTagging.CreatedAt.ToString());                                  
            Assert.AreEqual(tagging.Version, dbTagging.Version);                                      
            Assert.AreEqual(tagging.UpdatedAt.ToString(), dbTagging.UpdatedAt.ToString());                                  
            Assert.AreEqual(dbTagging.WorkflowState, eFormShared.Constants.WorkflowStates.Created);
            Assert.AreEqual(tagging.Id, dbTagging.Id);
            //Assert.AreEqual(tagging.Tag, dbTagging.Tag); //TODO
            //Assert.AreEqual(tagging.CheckList, dbTagging.CheckList); //TODO
            Assert.AreEqual(tagging.TaggerId, dbTagging.TaggerId);
            Assert.AreEqual(tagging.TagId, dbTagging.TagId); //TODO
            Assert.AreEqual(tagging.CheckListId, dbTagging.CheckListId); //TODO
            Assert.AreEqual(tagging.CheckListId, checklist.Id);
            Assert.AreEqual(tagging.TagId, tag.Id);
            
        }
    }
}
{'fraction_non_alphanumeric': 0.1053654323653244, 'fraction_numerical': 0.017920760012954767, 'mean_word_length': 1.8373660030627872, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6014171', 'n_tokens_mistral': 2679, 'n_tokens_neox': 2528, 'n_words': 400}