예제 #1
0
        public void Can_not_use_if_already_disposed()
        {
            // Arrange
            var nativeTag = new Mock <INativeTag>();
            var tag       = new NativeTagWrapper(nativeTag.Object);

            // Act
            tag.Dispose();

            // Assert
            Assert.Throws <ObjectDisposedException>(() => tag.GetStatus());
        }
예제 #2
0
        public void Destroy_is_called_if_initialized_and_disposed()
        {
            // Arrange
            var nativeTag = new Mock <INativeTag>();
            var tag       = new NativeTagWrapper(nativeTag.Object);

            // Act
            tag.Initialize();
            tag.Dispose();

            // Assert
            nativeTag.Verify(m => m.plc_tag_destroy(It.IsAny <int>()), Times.Once);
        }