Пример #1
0
 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
 public void VerifyWritableForProperty()
 {
     var fixture = new Fixture();
     var assertion = new WritablePropertyAssertion(fixture);
     var property = typeof(PropertyHolder<object>).GetProperty("Property");
     assertion.Verify(property);
 }
 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
 }
 public void SutIsIdiomaticAssertion()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     // Exercise system
     var sut = new WritablePropertyAssertion(dummyComposer);
     // Verify outcome
     Assert.IsAssignableFrom<IdiomaticAssertion>(sut);
     // Teardown
 }
 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
 }
        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
 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));
 }
 public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion)
 {
     assertion.Verify(typeof(ParadigmTestClassCommand));
 }
Пример #14
0
		public void TestProperty(
			SampleBindable sut,
			WritablePropertyAssertion assertion)
		{
			assertion.VerifyProperty(() => sut.Property);
		}
 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
 }
 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));
        }