In order to test this code, you will need read/write access to the account entity of Dynamics 365, a Visual Studio IDE with .NET 4.5.2, and the Dynamics 365 NuGet packages to access the SDK libraries. The entity being tested must have its optimistic concurrency control enabled. In order to check whether your entity (account in this example) has optimistic concurrency control enabled, inspect its metadata by navigating to the following URL:
<OrganizationUrl>/api/data/v8.2/EntityDefinitions?$filter=SchemaName eq 'Account'&$select=IsOptimisticConcurrencyEnabled
Don't forget to replace <OrganizationUrl> with your instance's URL.