﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace x.util.test
{
    [TestClass]
    public class OtherTest
    {
        [TestMethod]
        public void test()
        {
            string utf8 = Encoding.UTF8.HeaderName;
            Console.WriteLine(utf8);

            long counter = 0;

            long result = Interlocked.Increment(ref counter);
            Console.WriteLine(Interlocked.Read(ref counter));

            result = Interlocked.Increment(ref counter);
            Console.WriteLine(Interlocked.Read(ref counter));
            
            result = Interlocked.Exchange(ref counter, 0);
            Console.WriteLine(Interlocked.Read(ref counter));

            result = Interlocked.Increment(ref counter);
            Console.WriteLine(Interlocked.Read(ref counter));
        }
    }
}
