コード例 #1
0
ファイル: Scenario.cs プロジェクト: rajeshgupthar/AutoFixture
 public void VerifyWritableForAllPropertiesOnMutableClass()
 {
     var fixture = new Fixture();
     var assertion = new WritablePropertyAssertion(fixture);
     var properties = typeof(DoublePropertyHolder<string, int>).GetProperties();
     assertion.Verify(properties);
 }
コード例 #2
0
		public void TestValueProperty(
			WritablePropertyAssertion assertion,
			ISchedulers schedulers)
		{
			var sut = new ObservableProperty<string>(schedulers);
			assertion.VerifyProperty(() => sut.Value);
		}
コード例 #3
0
ファイル: Scenario.cs プロジェクト: rajeshgupthar/AutoFixture
 public void VerifyWritableForProperty()
 {
     var fixture = new Fixture();
     var assertion = new WritablePropertyAssertion(fixture);
     var property = typeof(PropertyHolder<object>).GetProperty("Property");
     assertion.Verify(property);
 }
コード例 #4
0
 public void VerifyNullPropertyThrows()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new WritablePropertyAssertion(dummyComposer);
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.Verify((PropertyInfo)null));
     // Teardown
 }
コード例 #5
0
 public void SutIsIdiomaticAssertion()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     // Exercise system
     var sut = new WritablePropertyAssertion(dummyComposer);
     // Verify outcome
     Assert.IsAssignableFrom<IdiomaticAssertion>(sut);
     // Teardown
 }
コード例 #6
0
 public void ComposerIsCorrect()
 {
     // Fixture setup
     var expectedComposer = new Fixture();
     var sut = new WritablePropertyAssertion(expectedComposer);
     // Exercise system
     ISpecimenBuilder result = sut.Builder;
     // Verify outcome
     Assert.Equal(expectedComposer, result);
     // Teardown
 }
コード例 #7
0
        public void VerifyIllBehavedPropertySetterThrows()
        {
            // Fixture setup
            var composer = new Fixture();
            var sut = new WritablePropertyAssertion(composer);

            var propertyInfo = typeof(IllBehavedPropertyHolder<object>).GetProperty("PropertyIllBehavedSet");
            // Exercise system and verify outcome
            var e = Assert.Throws<WritablePropertyException>(() =>
                sut.Verify(propertyInfo));
            Assert.Equal(propertyInfo, e.PropertyInfo);
            // Teardown
        }
コード例 #8
0
ファイル: DateViewModelTests.cs プロジェクト: Winsto/Booking
 public void YearIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect<DateViewModel>.GetProperty<int>(sut => sut.Year));
 }
コード例 #9
0
 public void RemainingCapacityIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect<BookingViewModel>.GetProperty<int>(sut => sut.RemainingCapacity));
 }
コード例 #10
0
 public void QuantityIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect<BookingViewModel>.GetProperty<int>(sut => sut.Quantity));
 }
コード例 #11
0
 public void NameIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect<BookingViewModel>.GetProperty<string>(sut => sut.Name));
 }
コード例 #12
0
 public void DateIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect<BookingViewModel>.GetProperty<DateTime>(sut => sut.Date));
 }
コード例 #13
0
 public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion)
 {
     assertion.Verify(typeof(ParadigmTestClassCommand));
 }
コード例 #14
0
ファイル: BindableTests.cs プロジェクト: Galad/Hanno
		public void TestProperty(
			SampleBindable sut,
			WritablePropertyAssertion assertion)
		{
			assertion.VerifyProperty(() => sut.Property);
		}
コード例 #15
0
 public void VerifyReadOnlyPropertyDoesNotThrow()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new WritablePropertyAssertion(dummyComposer);
     var propertyInfo = typeof(ReadOnlyPropertyHolder<object>).GetProperty("Property");
     // Exercise system and verify outcome
     Assert.DoesNotThrow(() =>
         sut.Verify(propertyInfo));
     // Teardown
 }
コード例 #16
0
 public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion)
 {
     // Exercise system and verify outcome
     assertion.Verify(typeof (JSendClientSettings).GetProperties());
 }
コード例 #17
0
        public void Properties_AreWritable(WritablePropertyAssertion assertion, IFixture fixture)
        {
            fixture.MakeNonRecursive();

            assertion.Verify(typeof(GraphNode));
        }