私のテスト コード フラグメント:
using (ShimsContext.Create()) {
taskService = new ShimTaskService { TargetServerGet = () => "192.168.100.1", UserNameGet = () => "user", UserAccountDomainGet = () => "TestDomain" , UserPasswordGet = () => "p/w", RootFolderGet = () => new ShimTaskFolder { TasksGet = () => new List { new ShimTask {NameGet = () => taskName }}; エラーがあります:
> Cannot convert lambda expression to type system.collections.generic.List< Microsoft.Win32.TaskScheduler.Task>
> to return type system.collections.generic.List<
> Microsoft.Win32.TaskScheduler.TaskCollection>. How convert this
> collection?
// TaskGet:
public FakesDelegates.Func<TaskCollection> TasksGet { set; }
// TaskCollection:
public sealed class TaskCollection : IEnumerable<Task>, IEnumerable, IDisposable
{
public int Count { get; }
public Task this[int index] { get; }
public Task this[string name] { get; }
public void Dispose();
public IEnumerator<Task> GetEnumerator();
}