コード例 #1
0
 public void single_node_in_graph_that_is_not_a_test()
 {
     var graph = new AffectedGraph();
     graph.AddNode(new AffectedGraphNode(displayName: "display",
                                         isInterface: false,
                                         isTest: false,
                                         isRootNode: true,
                                         name: "A name",
                                         fullName: "name",
                                         assembly: "foo.dll",
                                         type: "Type",
                                         testDescriptors: new List<TestDescriptor>(),
                                         isChange: false, inTestAssembly: false, complexity:0));
     var classifier = new TestPathsGraphRiskClassifier();
     Assert.AreEqual(0, classifier.CalculateRiskFor(graph));
 }
コード例 #2
0
 public void node_and_direct_test_in_graph()
 {
     var graph = new AffectedGraph();
     graph.AddNode(new AffectedGraphNode(displayName: "display",
                                         isInterface: false,
                                         isTest: false,
                                         isRootNode: true,
                                         name: "A name",
                                         fullName: "fullnamecode",
                                         assembly: "foo.dll",
                                         type: "Type",
                                         testDescriptors: new List<TestDescriptor>(),
                                         isChange: false, inTestAssembly: false, complexity:0));
     graph.AddNode(new AffectedGraphNode(displayName: "display",
                                         isInterface: false,
                                         isTest: true,
                                         isRootNode: true,
                                         name: "A name",
                                         fullName: "fullnametest",
                                         assembly: "foo.dll",
                                         type: "Type",
                                         testDescriptors: new List<TestDescriptor>(),
                                         isChange: false, inTestAssembly: true, complexity:0));
     graph.AddConnection("fullnamecode", "fullnametest", false);
     var classifier = new TestPathsGraphRiskClassifier();
     Assert.AreEqual(100, classifier.CalculateRiskFor(graph));
 }
コード例 #3
0
 public void null_graph_returns_zero()
 {
     var classifier = new TestPathsGraphRiskClassifier();
     Assert.AreEqual(0, classifier.CalculateRiskFor(null));
 }