public void GivenKParameterOne_ShouldReturnTheSameList()
        {
            //Arrange
            var algorithm = new KJobAnonimization(1, _jobDictionary);

            //Act
            var anonymzed = algorithm.GetAnonymizedData(new List <Person>());

            //Assert
            Assert.IsTrue(anonymzed.All(p => p.Age == _people.First(x => x.FirstName == p.FirstName && x.Surname == p.Surname).Age));
        }
        public void GivenEmptyPeopleList_ShouldReturn_EmptyList()
        {
            //Arrange
            var algorithm = new KJobAnonimization(2, _jobDictionary);

            //Act
            var anonymzed = algorithm.GetAnonymizedData(new List <Person>());

            //Assert
            Assert.IsTrue(!anonymzed.Any());
        }
        public void GivenKParameter_GreaterThan_1_ShouldReturnAnonymyzedList(int parameterK)
        {
            //Arrange
            var algorithm = new KJobAnonimization(parameterK, _jobDictionary);
            //Act
            var anonymzed = algorithm.GetAnonymizedData(_people);

            //Assert

            Assert.AreEqual(_people.Count, anonymzed.Count);
            //All Groups have at least K people
            Assert.IsTrue(anonymzed.GroupBy(x => x.Job).Select(g => g.Count()).All(c => c >= parameterK));
        }