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 VerifyReadOnlyPropertyDoesNotThrow()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new WritablePropertyAssertion(dummyComposer);
            var propertyInfo  = typeof(ReadOnlyPropertyHolder <object>).GetProperty("Property");

            // Act & Assert
            Assert.Null(Record.Exception(() =>
                                         sut.Verify(propertyInfo)));
        }
        public void Properties_VerifyAssigned()
        {
            // arrange
            var assertion = new WritablePropertyAssertion(Fixture);

            // act
            var sut   = Fixture.Create <BikeShopWebApiInstaller>();
            var props = sut.GetType().GetProperties();

            // assert.
            assertion.Verify(props);
        }
Esempio n. 4
0
        public void Properties_VerifyAssigned()
        {
            // arrange
            var assertion = new WritablePropertyAssertion(Fixture);

            // act
            var sut   = Fixture.Create <WindsorRelease>();
            var props = sut.GetType().GetProperties();

            // assert.
            assertion.Verify(props);
        }
Esempio n. 5
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
        }
Esempio n. 6
0
        public void VerifyWellBehavedWritablePropertyDoesNotThrow()
        {
            // Fixture setup
            var composer = new Fixture();
            var sut      = new WritablePropertyAssertion(composer);

            var propertyInfo = typeof(PropertyHolder <object>).GetProperty("Property");

            // Exercise system and verify outcome
            Assert.Null(Record.Exception(() =>
                                         sut.Verify(propertyInfo)));
            // Teardown
        }
        public void VerifyIllBehavedPropertySetterThrows()
        {
            // Arrange
            var composer = new Fixture();
            var sut      = new WritablePropertyAssertion(composer);

            var propertyInfo = typeof(IllBehavedPropertyHolder <object>).GetProperty("PropertyIllBehavedSet");
            // Act & Assert
            var e = Assert.Throws <WritablePropertyException>(() =>
                                                              sut.Verify(propertyInfo));

            Assert.Equal(propertyInfo, e.PropertyInfo);
        }
Esempio n. 8
0
        public void AutoFixture_Idioms()
        {
            //arrange
            var fixture = new Fixture();

            var assertion = new WritablePropertyAssertion(fixture);
            //act
            var sut   = fixture.Create <Core.Blog>();
            var props = sut.GetType().GetProperties();

            //assert

            assertion.Verify(props);
        }
        public void Properties_VerifyAssigned()
        {
            // arrange
            var assertion = new WritablePropertyAssertion(Fixture);

            Fixture.Inject <IWindsorContainer>(new WindsorContainer());
            var sut = Fixture.Create <WindsorControllerActivator>();

            // act
            var props = sut.GetType().GetProperties();

            // assert.
            assertion.Verify(props);
        }
Esempio n. 10
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
        }
Esempio n. 11
0
 public void Test_user_profile_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <UserProfile>().Select(d => d.ApplicationUser));
     assertion.Verify(new Properties <UserProfile>().Select(d => d.BirthDate));
     assertion.Verify(new Properties <UserProfile>().Select(d => d.LastName));
     assertion.Verify(new Properties <UserProfile>().Select(d => d.Name));
     assertion.Verify(new Properties <UserProfile>().Select(d => d.Picture));
     assertion.Verify(new Properties <UserProfile>().Select(d => d.UserId));
 }
Esempio n. 12
0
 public void Test_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <UserDto>().Select(x => x.Email));
     assertion.Verify(new Properties <UserDto>().Select(x => x.Profile));
 }
Esempio n. 13
0
        public void Properties_AreWritable(WritablePropertyAssertion assertion, IFixture fixture)
        {
            fixture.MakeNonRecursive();

            assertion.Verify(typeof(GraphNode));
        }
Esempio n. 14
0
 public void Tets_Getter_And_Setters_CategoryDto(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <CategoryDto>().Select(c => c.Id));
     assertion.Verify(new Properties <CategoryDto>().Select(c => c.Name));
     assertion.Verify(new Properties <CategoryDto>().Select(c => c.Color));
 }
Esempio n. 15
0
 public void Test_user_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <LoginDto>().Select(d => d.Login));
     assertion.Verify(new Properties <LoginDto>().Select(d => d.Password));
 }
Esempio n. 16
0
 public void EnsuresSameValueInProperty(WritablePropertyAssertion assertion)
 {
     assertion.Verify(typeof(PropertySetter));
 }
Esempio n. 17
0
 public void NameIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <BookingViewModel> .GetProperty <string>(sut => sut.Name));
 }
Esempio n. 18
0
 public void Test_user_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <ApplicationUser>().Select(d => d.UserProfile));
 }
Esempio n. 19
0
 public void Properties_are_configured_from_constructor_parameters(WritablePropertyAssertion assertion) => assertion.Verify(typeof(LambdaConfigurator));
 public void Test_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <RegisterDto>().Select(d => d.Email));
     assertion.Verify(new Properties <RegisterDto>().Select(d => d.Password));
 }
Esempio n. 21
0
 public void DayIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <DateViewModel> .GetProperty <int>(sut => sut.Day));
 }
Esempio n. 22
0
 public void RemainingCapacityIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <BookingViewModel> .GetProperty <int>(sut => sut.RemainingCapacity));
 }
Esempio n. 23
0
 public void QuantityIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <BookingViewModel> .GetProperty <int>(sut => sut.Quantity));
 }
 public void Properties_are_configured_from_constructor_parameters(WritablePropertyAssertion assertion) => assertion.Verify(typeof(SnsLambdaConfigurator <TestNotification, TestNotificationHandler>));
Esempio n. 25
0
 public void DateIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <BookingViewModel> .GetProperty <DateTime>(sut => sut.Date));
 }
 public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion)
 {
     // Exercise system and verify outcome
     assertion.Verify(typeof(JSendClientSettings).GetProperties());
 }
Esempio n. 27
0
 public void AllWritableAssertionsShouldReturnAssignedValue(
     WritablePropertyAssertion assertion)
 {
     assertion.Verify(typeof(Employee));
 }