コード例 #1
0
 private DataSource GetDataSourceWithEntries(params DataEntry[] entries)
 {
     entries = entries.Select(e =>
         {
             e.SourceId = newSourceId;
             return e;
         }).ToArray();
     var mockDataSource = new DataSource
         {
             Id = newSourceId,
             DataEntries = entries,
             InputStatus = SourceStatus.PendingCalculation,
             DateEdit = DateTime.Now,
             UserName = "******",
             SourceErrors = Enumerable.Empty<SourceError>().ToList()
         };
     UnitOfWorkToReturnEntries(entries);
     return mockDataSource;
 }
コード例 #2
0
 private void SetupDataContextToReturnDataSource(DataSource source)
 {
     mockContext
         .Setup(context => context.GetDataSource<DataSource>(It.Is<Guid>(id => id == source.Id)))
         .Returns(source)
         .Verifiable();
 }