def METHOD_NAME(self):
    for numSwitchesPerEdge in [0, 1]:
        G = nk.generators.ErdosRenyiGenerator(100, 0.1).generate()
        G_old = copy(G)
        algo = nk.randomization.EdgeSwitchingInPlace(G, numSwitchesPerEdge + 1)
        self.assertEqual(algo.getNumberOfSwitchesPerEdge(), numSwitchesPerEdge + 1)
        algo.setNumberOfSwitchesPerEdge(numSwitchesPerEdge)
        self.assertEqual(algo.getNumberOfSwitchesPerEdge(), numSwitchesPerEdge)
        numSwitches = numSwitchesPerEdge * G.numberOfEdges()
        algo.run()
        self.assertEqual(G_old.numberOfNodes(), G.numberOfNodes())
        self.assertEqual(G_old.numberOfEdges(), G.numberOfEdges())
        if numSwitches > 0:
            self.assertNotEqual(sorted(G_old.iterEdges()), sorted(G.iterEdges()))
        else:
            self.assertEqual(sorted(G_old.iterEdges()), sorted(G.iterEdges()))
        self.assertGreaterEqual(algo.getNumberOfAffectedEdges(), numSwitches // 2)