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