public void Graph_ChnageVertexColorWithRandomColor_Success() { var loaderMock = new Mock <IDataLoader>(); loaderMock.Setup(m => m.LoadData()).Returns(_dummyFile); var randomMock = new Mock <Random>(); randomMock.Setup(s => s.Next(It.IsAny <int>(), It.IsAny <int>())).Returns(1); var graph = new DimacsGraph(loaderMock.Object, randomMock.Object); graph.InitializeGraph(); graph.InitializeAnts(_optionTwoColors.NumberOfAnts); graph.ColorVerticesRandomly(_optionTwoColors.NumberOfPartitions); graph.ColorVertexWithRandomColor(0, _optionTwoColors.NumberOfPartitions); Assert.AreEqual(1, graph.Vertices[graph.Ants[0]].Color); graph.ColorVertexWithRandomColor(1, _optionTwoColors.NumberOfPartitions); Assert.AreEqual(1, graph.Vertices[graph.Ants[1]].Color); }