예제 #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 VerifyWritableForProperty()
        {
            var fixture   = new Fixture();
            var assertion = new WritablePropertyAssertion(fixture);
            var property  = typeof(PropertyHolder <object>).GetProperty("Property");

            assertion.Verify(property);
        }
	    public void Test_UserInfoViewModel_auto_properties(WritablePropertyAssertion assertion)
		{
			var properties = new Properties<UserInfoViewModel>();
			assertion.Verify(properties.Select(x => x.BirthDate));
			assertion.Verify(properties.Select(x => x.LastName));
			assertion.Verify(properties.Select(x => x.Name));
			assertion.Verify(properties.Select(x => x.Picture));
		}
예제 #4
0
 public void Test_Getter_And_Setters_FoodDto(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Id));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Name));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Calories));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Type));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Created));
 }
예제 #5
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));
 }
        public void SutIsIdiomaticAssertion()
        {
            // Arrange
            var dummyComposer = new Fixture();
            // Act
            var sut = new WritablePropertyAssertion(dummyComposer);

            // Assert
            Assert.IsAssignableFrom <IdiomaticAssertion>(sut);
        }
        public void VerifyNullPropertyThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new WritablePropertyAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Verify((PropertyInfo)null));
        }
        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 ComposerIsCorrect()
        {
            // Arrange
            var expectedComposer = new Fixture();
            var sut = new WritablePropertyAssertion(expectedComposer);
            // Act
            ISpecimenBuilder result = sut.Builder;

            // Assert
            Assert.Equal(expectedComposer, result);
        }
예제 #10
0
        public void SutIsIdiomaticAssertion()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            // Exercise system
            var sut = new WritablePropertyAssertion(dummyComposer);

            // Verify outcome
            Assert.IsAssignableFrom <IdiomaticAssertion>(sut);
            // Teardown
        }
예제 #11
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
        }
예제 #12
0
 public void Test_Getter_And_Setters_FoodDto(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Id));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Name));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Category));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.CategoryId));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Currency));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.DeletedPictures));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Description));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Pictures));
     assertion.Verify(new Properties <FoodDto>().Select(c => c.Price));
 }
예제 #13
0
 public void Test_food_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <Food>().Select(d => d.Name));
     assertion.Verify(new Properties <Food>().Select(d => d.Description));
     assertion.Verify(new Properties <Food>().Select(d => d.Recept));
     assertion.Verify(new Properties <Food>().Select(d => d.Pictures));
     assertion.Verify(new Properties <Food>().Select(d => d.Price));
     assertion.Verify(new Properties <Food>().Select(d => d.Currency));
     assertion.Verify(new Properties <Food>().Select(d => d.Category));
     assertion.Verify(new Properties <Food>().Select(d => d.CategoryId));
     assertion.Verify(new Properties <Food>().Select(d => d.CategoryId));
 }
예제 #14
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
        }
        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);
        }
예제 #16
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
        }
예제 #17
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);
        }
        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);
        }
예제 #19
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
        }
예제 #20
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);
        }
예제 #21
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
        }
        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);
        }
예제 #23
0
 public void EnsuresSameValueInProperty(WritablePropertyAssertion assertion)
 {
     assertion.Verify(typeof(PropertySetter));
 }
예제 #24
0
        public void Properties_AreWritable(WritablePropertyAssertion assertion, IFixture fixture)
        {
            fixture.MakeNonRecursive();

            assertion.Verify(typeof(GraphNode));
        }
예제 #25
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));
 }
예제 #26
0
 public void RemainingCapacityIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <BookingViewModel> .GetProperty <int>(sut => sut.RemainingCapacity));
 }
예제 #27
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));
 }
예제 #28
0
 public void DayIsWritable(WritablePropertyAssertion assertion)
 {
     assertion.Verify(Reflect <DateViewModel> .GetProperty <int>(sut => sut.Day));
 }
 public void WritablePropertiesBehaveCorrectly(WritablePropertyAssertion assertion)
 {
     // Exercise system and verify outcome
     assertion.Verify(typeof(JSendClientSettings).GetProperties());
 }
예제 #30
0
 public void Test_user_auto_properties(WritablePropertyAssertion assertion)
 {
     assertion.Verify(new Properties <ApplicationUser>().Select(d => d.UserProfile));
 }