Пример #1
0
        public void MatchesPlatform()
        {
            try
            {
                // Arrange.
                Setup();
#if OS_WINDOWS
                const string Platform = "WiNdOwS";
#else
                // TODO: What to do here?
                const string Platform = "";
                if (string.IsNullOrEmpty(Platform))
                {
                    return;
                }
#endif
                HandlerData data = new NodeHandlerData() { Platforms = new[] { Platform } };

                // Act/Assert.
                Assert.True(data.PreferredOnCurrentPlatform());
            }
            finally
            {
                Teardown();
            }
        }
Пример #2
0
        public void DoesNotMatchPlatform()
        {
            try
            {
                // Arrange.
                Setup();
#if !OS_WINDOWS
                const string Platform = "windows";
#else
                const string Platform = "nosuch"; // TODO: What to do here?
#endif
                HandlerData data = new NodeHandlerData() { Platforms = new string[] { Platform } };

                // Act/Assert.
                Assert.False(data.PreferredOnCurrentPlatform());
            }
            finally
            {
                Teardown();
            }
        }