NUnit = Red Bar에서이 테스트를 실행할 때. 내가 Testdriven.Net와 비주얼 스튜디오 내에서이 테스트를 실행할 때NUnit/Testdriven.Net 충돌하는 결과
[Test]
public void ChangingValueViaPropertyDescriptorRaisesPropertyChangedNotification()
{
PropertyChangedEventArgs pCEventArgs = null;
subjectVM.PropertyChanged += (sender, e) => { pCEventArgs = e; };
PropertyDescriptor descriptor = subjectVM.GetProperties().Find(schoolMeta.Name, false);
descriptor.SetValue(null, "School's out for summer.");
Assert.IsNotNull(pCEventArgs);
Assert.AreEqual("School", pCEventArgs.PropertyName);
}
는하지만, (콘솔 응용 프로그램에서 실행할 때 그것은 또한 괜찮습니다) 전달합니다.
NUnit과 함께 실패하면 PropertyChanged가 null이기 때문에 subjectVM은 기본 클래스에서 PropertyChanged를 상속하는 View Model 클래스입니다.
나는 비난해야합니까, 아니면 NUnit 버그를보고 있습니까?
PropertyChanged가 null이거나 pcEventArgs가 NUnit과 함께 null이라는 것을 의미합니까? – Paolo
다른 테스트 장치가 다른 순서로 테스트를 실행합니다.이 테스트는 실행되는 순서에 암시 적으로 종속됩니까? 아마도 또 다른 테스트가'subjectVM'에 뭔가 비린내를 내고있을 것입니까? (이것은 클래스 멤버 인 것처럼 보입니다.) –
@Paolo, 아니요. PropertyChanged가 null이라는 것을 의미합니다. NUnit 테스트 러너가 알 수 있도록 다양한 장소에 예외를 삽입하고 NUnit에서 테스트를 다시 실행하여이를 발견했습니다. if까지 (PropertyChanged! = null) 그러나 더 이상. – Grokodile