Thank you for sending the issue. Unfortunately, since you can't arrange a constructor therefore it would be hard to assert if a constructor is called with particular arguments. In that case you could write the test in the following way:
Mock.Partial<MemoryStream>().For<Stream>((x, i) => x.WriteTo(i));
var stream =
path = String.Format(
, AppDomain.CurrentDomain.BaseDirectory, DateTime.Now.ToString(
Mock.Arrange(() => stream.WriteTo(Arg.IsAny<Stream>())).MustBeCalled();
(var filStream =
Mock.Assert(() => stream.WriteTo(Arg.IsAny<Stream>()), Occurs.Exactly(1));
However, faking constructor for specific arguments is a great idea and we would love to include it in one of coming releases. Once included, you will then be able to do the following to fake any constructor and assert it later on (like you do it for static methods):
Thanks again for using JustMock and Please write us back for any other issues that you might get.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items