public void SetUp() { replica = new Uri("http://replica"); replicas = new List <Uri> { replica }; request = Request.Get("foo/bar"); modifiers = new List <IReplicaWeightModifier>(); storageProvider = Substitute.For <IReplicaStorageProvider>(); calculator = new ReplicaWeightCalculator(modifiers, minWeight, maxWeight, initialWeight); }
public void TestSetup() { replica = new Uri("http://replica"); replicas = new List <Uri> { replica }; request = Request.Get("foo/bar"); parameters = RequestParameters.Empty; modifiers = new List <IReplicaWeightModifier>(); storageProvider = Substitute.For <IReplicaStorageProvider>(); calculator = new ReplicaWeightCalculator(modifiers, MinWeight, MaxWeight, InitialWeight); }
public void GetWeight_should_convert_NaN_weight_to_zero() { calculator = new ReplicaWeightCalculator(modifiers, MinWeight, MaxWeight, double.NaN); calculator.GetWeight(replica, replicas, storageProvider, request, parameters).Should().Be(0); }