Skip to content

[UnitTest/Framework] - Refactoring Unit-Tests / Switching to .Net Core #38

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 45 commits into from
Dec 11, 2017
Merged

[UnitTest/Framework] - Refactoring Unit-Tests / Switching to .Net Core #38

merged 45 commits into from
Dec 11, 2017

Conversation

ivandrofly
Copy link
Collaborator

@ivandrofly ivandrofly commented May 28, 2017

⚠️ Under Construction ⛑

TODOS:

  • Change Algorithms project to .net core
  • Change DataStructures projects to .net core
  • Remove "MainProgram" test.

Algorithms Tests

  • BinarySearchTreeSorterTest
  • BinaryTreeRecursiveWalkerTests
  • CatalanNumbersTest
  • CountingSortTest
  • GraphsBellmanFordShortestPaths
  • GraphsBipartiteColoringTest
  • GraphsBreadthFirstPathsTest
  • GraphsBreadthFirstSearchTest
  • GraphsConnectedComponents
  • GraphsCyclesDetectorTests
  • GraphsDepthFirstSearchTest
  • GraphsDijkstraShortestPathsTest
  • GraphsTopologicalSorterTest
  • GreatestCommonDivisorTest
  • HeapSorterTest
  • InsertionSortTest
  • LSDRadixSorterTest
  • MergeSorterTest
  • QuickSortTest
  • StringEditDistanceTest
  • StringPermutationTests

Data Structures Tests

  • ArrayListTest
  • AVLTreeTest
  • BinaryHeapsTest
  • BinarySearchTreeMapTests
  • BinarySearchTreeTest
  • BinomialHeapsTest
  • CliqueGraphTest
  • CuckooHashTableTest
  • DLinkedListTest
  • GraphsDirectedDenseGraphTest
  • GraphsDirectedSparseGraphTest
  • GraphsDirectedWeightedDenseGraphTest
  • GraphsDirectedWeightedSparseGraphTest
  • GraphsUndirectedDenseGraphTest
  • GraphsUndirectedSparseGraphTest
  • GraphsUndirectedWeightedDenseGraphTest
  • GraphsUndirectedWeightedSparseGraphTest
  • HashTableSeparateChainingTest
  • PriorityQueuesTest
  • QueueTest
  • RedBlackTreeMapTests
  • RedBlackTreeTest ⚠️
  • SkipListTest
  • SLinkedListTest
  • SortedDictionaryTests
  • SortedListTests
  • StackTest
  • TrieMapTest
  • TrieTest

Misc

  • Fix broken codes and cleanup
  • Ready for merge

Framework changes:

ApplicationException => InvalidOperationException
Assembly.GetExecutingAssembly().Location => typeof(PrimesList).GetTypeInfo().Assembly.Location

@ivandrofly ivandrofly mentioned this pull request Jun 1, 2017
@aalhour aalhour self-requested a review July 3, 2017 15:53
@ivandrofly
Copy link
Collaborator Author

ivandrofly commented Jul 3, 2017

I have been very busy lately... next week I'll continue coding this patch 😉 /cc @aalhour

@aalhour
Copy link
Owner

aalhour commented Jul 5, 2017

Hey @ivandrofly, sure thing, no worries 😉

@ivandrofly
Copy link
Collaborator Author

Seems like we are having conflicts with this branch...

@ivandrofly
Copy link
Collaborator Author

Couple more then we finish... :)

PS: The conflicts also need to be resolved

Copy link
Collaborator Author

@ivandrofly ivandrofly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails there is a Debug.Assert inside DijkstraShortestPaths.cs -> _checkOptimalityConditions()

 // check that all edges e = v->w satisfy distTo[w] <= distTo[v] + e.weight()
            foreach (var vertex in graph.Vertices)
            {
                int v = _nodesToIndices[vertex];

                foreach (var edge in graph.NeighboursMap(vertex))
                {
                    int w = _nodesToIndices[edge.Key];

                    if (_distances[v] + edge.Value < _distances[w])
                    {
                        Console.WriteLine("edge " + vertex + "-" + edge.Key + " is not relaxed");
                        return false;
                    }
                }
            }

@aalhour
Copy link
Owner

aalhour commented Nov 19, 2017

Hello @ivandrofly,

I have just merged PR #49, it might cause some problems with your migration. Can you take a look at it when you're done?

Regarding the assertion inside the DijkstraShortestPaths.cs source file, let's remove it and replace it with an Exception instead.

Cheers,
Ahmad

@ivandrofly
Copy link
Collaborator Author

I have rebased and fixed most of the problem... I think this branch is ready to be merged and the remaining tests can be send in separated PR in order to avoid more merge conflicts in future. /cc @aalhour

PS: I have some modified files (locally) which can cause some red squiggly in VS after merged with master branch, that will be fixed in next PR.

@aalhour
Copy link
Owner

aalhour commented Dec 11, 2017

Hello @ivandrofly,

Sorry for the late reply, I was very busy lately. This sounds good to me. I will merge it now and will be waiting for your next PR.

Cheers,
Ahmad

@aalhour aalhour merged commit c086cc8 into aalhour:master Dec 11, 2017
MetSystem pushed a commit to MetSystem/C-Sharp-Algorithms that referenced this pull request Sep 6, 2018
aalhour#38)

* Adding unit-test & switch to .net core

* [CountingSortTest] - add assert

* [CatalanNumbersTest] - remove console codes.

* [BinarySearchTreeTest] - fix unit-tests

* [BinomialHeapsTest] - fix unit-test

* [QueueTest] - fix unit-test

* [TrieTest] - fix unit-test

* [TrieMap] - fix unit-test

* [StackTest] - fix unit-test

* [SortedDictionaryTests] - Fix uni-test

* [SortedListTests] - Fix unit-test

* [LinkedListTest] - fix unit-test

* [QueueTest] - minor fixes

* [PriorityQueuesTest]  - fix unit-test

* update unit-test framework

* [HashTableSeparateChainingTest] - fix unit-test

* [ArrayListTest] - fix unit-test

* [GraphsUndirectedWeightedSparseGraphTest] - fix unit-texts

* [DLinkedListTest] - fix unit-test

* remove underscore in class name

* [SkipListTest] - fix unit-test

* [GraphsDirectedSparseGraphTest] - fix unit-test

* [GraphsUndirectedWeightedDenseGraphTest] - fix unit-test part 1

* [GraphsUndirectedSparseGraphTest] - fix unit-test.

* [GraphsUndirectedDenseGraphTest] - fix unit-test

* [redblacktreetest] - mino fixes

* [AVLTreeTest] - fix unit-test

* [BinarySearchTreeMapTests] - fix unit-test

* [BinaryHeapsTest - fix unit-test

* [CuckooHashTableTest] - fix unit-test

* [GraphsDirectedDenseGraphTest] - fix unit-test

* [RedBlackTreeMapTests] - fix unitest

* minor cleanup/refact

* [StringPermutationTests] - fix unit test

* [HeapSorterTest] - fix unit test

* [LSDRadixSorterTest] - fix unit test

* [MergeSorterTest] - fix unit test

* [QuickSortTest] - fix unit test

* [StringEditDistanceTest] - fix unit test

* [GraphsBreadthFirstSearchTest - fix unit-test

* [GraphsDijkstraShortestPathsTest] - "fix unit-test"

* [GraphsCyclesDetectorTests] - fix unit test

* [InsertionSortTest] - fix unit-test

* update project files

* update project file
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants