示例#1
0
        public void GetAmbisonic_ShouldThrowExceptionOnOneResult()
        {
            var marshallerMock = new Mock<ILibsndfileMarshaller>();

            var mock = new Mock<ILibsndfileApi>();
            mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), It.IsAny<IntPtr>(), It.IsAny<int>())).Returns(1);

            var api = new LibsndfileCommandApiNativeWrapper(mock.Object, marshallerMock.Object);
            api.GetAmbisonic(new IntPtr(1));
        }
示例#2
0
        public void GetAmbisonic_ShouldThrowExceptionOnOneResult()
        {
            var marshallerMock = new Mock <ILibsndfileMarshaller>();

            var mock = new Mock <ILibsndfileApi>();

            mock.Setup(x => x.Command(It.IsAny <IntPtr>(), It.IsAny <LibsndfileCommand>(), It.IsAny <IntPtr>(), It.IsAny <int>())).Returns(1);

            var api = new LibsndfileCommandApiNativeWrapper(mock.Object, marshallerMock.Object);

            api.GetAmbisonic(new IntPtr(1));
        }
示例#3
0
        public void GetAmbisonic_ShouldPassOnZeroResult()
        {
            const int Result = 0;

            var marshallerMock = new Mock<ILibsndfileMarshaller>();

            var mock = new Mock<ILibsndfileApi>();
            mock.Setup(x => x.Command(It.IsAny<IntPtr>(), It.IsAny<LibsndfileCommand>(), It.IsAny<IntPtr>(), It.IsAny<int>())).Returns(Result);

            var api = new LibsndfileCommandApiNativeWrapper(mock.Object, marshallerMock.Object);
            var retval = api.GetAmbisonic(new IntPtr(1));

            Assert.AreEqual(Convert.ToBoolean(Result), retval);
        }
示例#4
0
        public void GetAmbisonic_ShouldPassOnAmbisonicBResult()
        {
            const int Result = 0x41;

            var marshallerMock = new Mock <ILibsndfileMarshaller>();

            var mock = new Mock <ILibsndfileApi>();

            mock.Setup(x => x.Command(It.IsAny <IntPtr>(), It.IsAny <LibsndfileCommand>(), It.IsAny <IntPtr>(), It.IsAny <int>())).Returns(Result);

            var api    = new LibsndfileCommandApiNativeWrapper(mock.Object, marshallerMock.Object);
            var retval = api.GetAmbisonic(new IntPtr(1));

            Assert.IsTrue(retval);
        }