示例#1
0
        private void AutoTest(Func <IterationData, TimeInterval> measure, int min, int max = -1, IterationMode mode = IterationMode.MainTarget)
        {
            if (max == -1)
            {
                max = min;
            }
            var job          = Job.Default;
            var stage        = CreateStage(job, measure);
            var measurements = stage.Run(1, mode, Characteristic <int> .Create(""));
            int count        = measurements.Count;

            output.WriteLine($"MeasurementCount = {count} (Min= {min}, Max = {max})");
            Assert.InRange(count, min, max);
        }
示例#2
0
 private static ICharacteristic <T> Create <T>(string id) => Characteristic <T> .Create("Run", id);
 protected static Characteristic <TC> CreateCharacteristic <TC>(string memberName) => Characteristic.Create <T, TC>(memberName);
示例#4
0
        public static EstablishmmentById ToEstablishmmentById(this EstablishmmentModelData data)
        {
            var establishmment = EstablishmmentById.Create(
                data.Id.ToString(),
                data.Name,
                string.Join(", ", data.Address.Street, data.Address.Number, data.Address.State, data.Address.Coutry, data.Address.Zipcode),
                data.Email,
                data.Phone,
                data.TimeOpen,
                data.TimeClose);

            var desWifi = "";

            switch (data.Wifi)
            {
            case 0:
                desWifi = "não tem";
                break;

            case 1:
                desWifi = "fraco";
                break;

            case 2:
                desWifi = "médio";
                break;

            case 3:
                desWifi = "forte";
                break;

            default:
                desWifi = "";
                break;
            }

            var desNoise = "";

            switch (data.Noise)
            {
            case 0:
                desNoise = "não tem";
                break;

            case 1:
                desNoise = "pouco";
                break;

            case 2:
                desNoise = "médio";
                break;

            case 3:
                desNoise = "muito";
                break;

            default:
                desWifi = "";
                break;
            }

            var desPlug = "";

            switch (data.Plug)
            {
            case 0:
                desPlug = "não tem";
                break;

            case 1:
                desPlug = "pouco";
                break;

            case 2:
                desPlug = "alguns";
                break;

            case 3:
                desPlug = "vários";
                break;

            default:
                desWifi = "";
                break;
            }


            establishmment.SetCharacteristics(Characteristic.Create(data.Wifi, desWifi),
                                              Characteristic.Create(data.Noise, desNoise),
                                              Characteristic.Create(data.Plug, desPlug));
            data.Photos.ForEach(x => establishmment.AddPhoto(x.UrlPhoto));

            return(establishmment);
        }
示例#5
0
 private static ICharacteristic <T> Create <T>(string id) => Characteristic <T> .Create("Env", "Gc" + id);
示例#6
0
 private static ICharacteristic <T> Create <T>(string id) => Characteristic <T> .Create("Infrastructure", id);
 public void AddService(HasCharacteristc hasNotHas, ServiceOffered serviceOffered, ServiceOfferedQuality serviceOfferedQuality)
 {
     this.Characteristics.Add(Characteristic.Create(hasNotHas, serviceOffered, serviceOfferedQuality));
 }