tag:blogger.com,1999:blog-804807863784809914.post203795588403011410..comments2024-03-28T09:46:41.753+01:00Comments on Legend and truth: FakeItEasy Login Service Example Series – Part 4Patrik Hägnehttp://www.blogger.com/profile/09722697680972465898noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-804807863784809914.post-88630336355741476772010-05-29T11:07:32.327+02:002010-05-29T11:07:32.327+02:00Don't mention it man, hope you like FakeItEasy...Don't mention it man, hope you like FakeItEasy!Patrik Hägnehttps://www.blogger.com/profile/09722697680972465898noreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-31651685958543829432010-05-27T14:54:52.924+02:002010-05-27T14:54:52.924+02:00Told you i was dummy. Thanks a lot. Sorry for the ...Told you i was dummy. Thanks a lot. Sorry for the inconvenience.Archaeushttps://www.blogger.com/profile/16510871556773507888noreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-2436528742158490402010-05-27T14:47:12.284+02:002010-05-27T14:47:12.284+02:00If the Interval property is read/write you can jus...If the Interval property is read/write you can just check the value like this:<br /><br />Assert.That(timer.Interval, Is.EqualTo(TimeSpan.FromMinutes(1));<br /><br />If the Interval property is write only this is something that is not really well supported in FakeItEasy, mainly since I believe that a set only property may not be the best design choice for an interface. However you can do it quite easily like this:<br /><br />FakeItEasy.VisualBasic.NextCall.To(timer).WhenArgumentsMatch(x => x.Get(0) == TimeSpan.FromMinutes(1)).MustHaveHappened();<br /> timer.Interval = new TimeSpan();Patrik Hägnehttps://www.blogger.com/profile/09722697680972465898noreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-27315058528104174502010-05-27T14:32:17.082+02:002010-05-27T14:32:17.082+02:00Sorry for the off topic. But right now I'm pre...Sorry for the off topic. But right now I'm pretty dummed down. Hopefully you can help me out. I've been porting my tests from RhinoMocks to FakeItEasy. You should know that the tests were written 3-4 years ago. So they might not be the best way to test code but...<br />There was a test that verified that ,on a fake, a property setter was called with a specific value. <br />I joyfully converted the rhino version and got : A.CallTo(()=>timer.Interval=TimeSpan.FromMinutes(1)).MustHaveHappened(); <br />This does not compile: error CS0832: An expression tree may not contain an assignment operator.<br />What would be an alternative syntax for this case?Archaeushttps://www.blogger.com/profile/16510871556773507888noreply@blogger.com