<commit_before>﻿using System.Linq;
using System.Net;
using NUnit.Framework;
using SharpTestsEx;
using TellagoStudios.Hermes.Client.Tests.Util;

namespace TellagoStudios.Hermes.Client.Tests.IntegrationTests
{
    [TestFixture, Explicit]
    public class GroupsDemo : IntegrationTestBase
    {
        private readonly HermesClient client = new HermesClient("http://localhost:40403");

        [Test]
        public void CanCreateGroup()
        {
            var group = client.CreateGroup("TestGroup", "TestDescription");
            group.Satisfy(g => g.Name == "TestGroup" && g.Description == "TestDescription");
        }

        [Test]
        public void CanCreateGroupWithoutDescription()
        {
            var group = client.CreateGroup("TestGroup");
            group.Satisfy(g => g.Name == "TestGroup" && string.IsNullOrEmpty(g.Description));
        }

        [Test]
        public void WhenCreatingTwoGroupsWithSameName_ThenFail()
        {
            client.CreateGroup("TestGroup", "TestDescription");
            client.Executing(c => c.CreateGroup("TestGroup", "TestDescription"))
                  .Throws<WebException>();
        }
        
        [Test]
        public void CanDeleteAGroup()
        {
            var group = client.CreateGroup("Test");
            client.DeleteGroup(group.Id);
        }

        [Test]
        public void CanGetAGroup()
        {
            client.CreateGroup("Test", "Foo");<commit_msg>minor<commit_after>﻿using System.Linq;
using System.Net;
using NUnit.Framework;
using SharpTestsEx;
using TellagoStudios.Hermes.Client.Tests.Util;

namespace TellagoStudios.Hermes.Client.Tests.IntegrationTests
{
    [TestFixture, Explicit]
    public class GroupsDemo : IntegrationTestBase
    {
        private readonly HermesClient client = new HermesClient("http://localhost:40403");

        [Test]
        public void CanCreateGroup()
        {
            var group = client.CreateGroup("TestGroup", "TestDescription");
            group.Satisfy(g => g.Name == "TestGroup" && g.Description == "TestDescription");
        }

        [Test]
        public void CanCreateGroupWithoutDescription()
        {
            var group = client.CreateGroup("TestGroup");
            group.Satisfy(g => g.Name == "TestGroup" && string.IsNullOrEmpty(g.Description));
        }

        [Test]
        public void WhenCreatingTwoGroupsWithSameName_ThenFail()
        {
            client.CreateGroup("TestGroup", "TestDescription");
            client.Executing(c => c.CreateGroup("TestGroup", "TestDescription"))
                  .Throws<WebException>();
        }
        
        [Test]
        public void CanDeleteAGroup()
        {
            var group = client.CreateGroup("Test");
            client.DeleteGroup(group.Id);
        }

        [Test]
        public void CanGetGroups()
        {
            client.CreateGroup("Test", "Foo");
{'fraction_non_alphanumeric': 0.11472011057360056, 'fraction_numerical': 0.0034554250172771253, 'mean_word_length': 2.3085714285714287, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7383820', 'n_tokens_mistral': 799, 'n_tokens_neox': 773, 'n_words': 143}