我正在尝试使用MOQ对以下ViewModel的LoginExecute方法进行单元测试
public class LoginViewModel : ViewModelBase, ILoginViewModel
{
INavigationService navigationService;
IDialogService dialogService;
IAdminService adminService;
public RelayCommand LoginCommand { get; set; }
private string _productID;
public string ProductID
{
get { return _productID; }
set
{
_productID = value;
RaisePropertyChanged("ProductID");
}
}
public LoginViewModel(INavigationService navigationService, IDialogService dialogService, IAdminService adminService)
{
this.navigationService = navigationService;
this.dialogService = dialogService;
this.adminService = adminService;
InitializeCommands();
}
private void InitializeCommands()
{
LoginCommand = new RelayCommand(() => LoginExecute());
}
public async Task LoginExecute()
{
await this.navigationService.TestMethod();
this.navigationService.Navigate(typeof(ITherapistsViewModel));
} …Run Code Online (Sandbox Code Playgroud) 假设我有一个包含 50K 行的 Azure 存储表,其中包含这样的实体
{
PartitionKey,
RowKey,
Name,
Price
}
Run Code Online (Sandbox Code Playgroud)
查询会是这样的
var query = from entity in dataServiceContext.CreateQuery<MyEntity>(tableName)
where entity.Price == 10
select new { entity.Name};
Run Code Online (Sandbox Code Playgroud)
当我需要搜索 Price == 10 的所有实体时,交易是否仅根据返回的结果数进行计数?或者每个实体 (entity.Price == 10) 的检查是否会被计为单独的读取事务,这会导致 50K 事务?