本文整理汇总了C#中LibsndfileApi.Command方法的典型用法代码示例。如果您正苦于以下问题:C# LibsndfileApi.Command方法的具体用法?C# LibsndfileApi.Command怎么用?C# LibsndfileApi.Command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibsndfileApi
的用法示例。
在下文中一共展示了LibsndfileApi.Command方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommandDoubleArray_ShouldThrowExceptionOnInvalidResult
public void CommandDoubleArray_ShouldThrowExceptionOnInvalidResult()
{
var data = new double[1];
var mock = new Mock<ILibsndfileApi>();
mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), data, It.IsAny<int>())).Returns(-1);
var api = new LibsndfileApi(mock.Object);
api.Command(new IntPtr(1), It.IsAny<LibsndfileCommand>(), data, It.IsAny<int>());
}
示例2: CommandDoubleArray_ShouldPassOnZeroHandleWithStaticCommand
public void CommandDoubleArray_ShouldPassOnZeroHandleWithStaticCommand()
{
var data = new double[1];
var mock = new Mock<ILibsndfileApi>();
mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), It.IsAny<double[]>(), It.IsAny<int>())).Returns(1);
var api = new LibsndfileApi(mock.Object);
var retval = api.Command(IntPtr.Zero, LibsndfileCommand.GetLibVersion, data, It.IsAny<int>());
Assert.Greater(retval, 0);
}
示例3: CommandDouble_ShouldThrowExceptionOnZeroHandleWithNonStaticCommand
public void CommandDouble_ShouldThrowExceptionOnZeroHandleWithNonStaticCommand()
{
var doubleRef = It.IsAny<double>();
var api = new LibsndfileApi();
api.Command(IntPtr.Zero, LibsndfileCommand.GetLogInfo, ref doubleRef, It.IsAny<int>());
}
示例4: CommandDoubleArray_ShouldThrowExceptionOnNullData
public void CommandDoubleArray_ShouldThrowExceptionOnNullData()
{
var api = new LibsndfileApi();
double[] data = null;
api.Command(new IntPtr(1), It.IsAny<LibsndfileCommand>(), data, It.IsAny<int>());
}
示例5: CommandLong_ShouldThrowExceptionOnInvalidResult
public void CommandLong_ShouldThrowExceptionOnInvalidResult()
{
var longRef = It.IsAny<long>();
var mock = new Mock<ILibsndfileApi>();
mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), ref longRef, It.IsAny<int>())).Returns(-1);
var api = new LibsndfileApi(mock.Object);
api.Command(new IntPtr(1), It.IsAny<LibsndfileCommand>(), ref longRef, It.IsAny<int>());
}
示例6: CommandLong_ShouldPassOnZeroHandleWithStaticCommand
public void CommandLong_ShouldPassOnZeroHandleWithStaticCommand()
{
var longRef = It.IsAny<long>();
var mock = new Mock<ILibsndfileApi>();
mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), ref longRef, It.IsAny<int>())).Returns(1);
var api = new LibsndfileApi(mock.Object);
var retval = api.Command(IntPtr.Zero, LibsndfileCommand.GetLibVersion, ref longRef, It.IsAny<int>());
Assert.Greater(retval, 0);
}
示例7: CommandIntPtr_ShouldThrowExceptionOnZeroHandleWithNonStaticCommand
public void CommandIntPtr_ShouldThrowExceptionOnZeroHandleWithNonStaticCommand()
{
var api = new LibsndfileApi();
api.Command(IntPtr.Zero, LibsndfileCommand.GetLogInfo, It.IsAny<IntPtr>(), It.IsAny<int>());
}