developwithpassion / developwithpassion.specifications Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
When I run this code on version 0.4.21.5:
public class Test
{
public string Property
{
get { return null; }
}
}
public class when_observing_test : Observes<Test>
{
It should_not_fail_but_it_does = () => Console.WriteLine("Will fail");
}
I get:
System.ArgumentException: Property set method not found.
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at developwithpassion.specifications.core.reflection.PropertyInfoMemberAccessor.change_value_to(Object target, Object new_value) in PropertyInfoMemberAccessor.cs: line 27
at developwithpassion.specifications.core.factories.NonCtorDependencySetter.<>c__DisplayClass7.<attempt_to_update_all_of_the_accessors>b__5(MemberAccessor accessor) in NonCtorDependencySetter.cs: line 42
at developwithpassion.specifications.extensions.IterationExtensions.each(IEnumerable1 items, Action
1 action) in IterationExtensions.cs: line 13
at developwithpassion.specifications.core.factories.NonCtorDependencySetter.attempt_to_update_all_of_the_accessors(IEnumerable1 accessors_to_update, Object target) in NonCtorDependencySetter.cs: line 40 at developwithpassion.specifications.core.factories.NonCtorDependencySetter.update(Object item) in NonCtorDependencySetter.cs: line 35 at developwithpassion.specifications.faking.DefaultSUTFactory
1.create_automatically() in DefaultSUTFactory.cs: line 32
at developwithpassion.specifications.faking.DefaultSUTFactory1.create() in DefaultSUTFactory.cs: line 23 at developwithpassion.specifications.DefaultTestStateFor
1.build_sut() in DefaultTestStateFor.cs: line 32
at developwithpassion.specifications.DefaultTestStateFor1.run_setup() in DefaultTestStateFor.cs: line 43 at developwithpassion.specifications.DefaultObservationController
2.run_setup() in DefaultObservationController.cs: line 51
at developwithpassion.specifications.observations.InstanceObservations`3.<.ctor>b__0() in InstanceObservations.cs: line 14
In my production code Test.Property isn't really implemented like that. It's a calculated property and it just returns null in certain situations. Our unit tests fail then.
When Test class looks like this:
public class Test
{
public string Property
{
get { return "property value"; }
}
}
all works fine.
It was working ok with version 0.4.13.0 which we were using previously.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.