Выполнение того же тестового сценария JUnit несколько время с различными данными

В конце концов нашли решение, с некоторой удачей, чтобы быть честным:

this.nativeView = UIView.alloc().initWithFrame(UIScreen.mainScreen.bounds)
let ref = new interop.Reference(interop.Pointer, this.nativeView)
initViewStyleRemoteParticipantsLogFileFilterLogFileName(ref, [...])

Довольно просто, но документация не была ясна об этом. Надеюсь, это поможет

74
задан Welbog 15 April 2009 в 16:25
поделиться

3 ответа

взгляните на теории junit 4.4 :

import org.junit.Test;
import org.junit.experimental.theories.*;
import org.junit.runner.RunWith;

@RunWith(Theories.class)
public class PrimeTest {

    @Theory
    public void isPrime(int candidate) {
          // called with candidate=1, candidate=2, etc etc  
    }

    public static @DataPoints int[] candidates = {1, 2, 3, 4, 5};
}
65
ответ дан dfa 24 November 2019 в 12:01
поделиться

I always just make a helper method that executes the test based on the parameters, and then call that method from the JUnit test method. Normally this would mean a single JUnit test method would actually execute lots of tests, but that wasn't a problem for me. If you wanted multiple test methods, one for each distinct invocation, I'd recommend generating the test class.

2
ответ дан Mr. Shiny and New 安宇 24 November 2019 в 12:01
поделиться

Похоже, что .NET несколько улучшилась в этом отношении за последние несколько лет. Похоже, что объект System.Xml.XmlConvert предназначен для удовлетворения целого класса потребностей, возникающих в этом контексте. 0 .

24
ответ дан 24 November 2019 в 12:01
поделиться
Другие вопросы по тегам:

Похожие вопросы: