Example #1
0
        public void GetFileTranslationTest()
        {
            ContentAPI         client = ConstructServiceClient();
            IEnumerable <File> files  = client.ListFiles();

            foreach (File file in files)
            {
                int    assetID      = file.AssetID;
                String languageCode = "en-us";

                try
                {
                    Byte[] content = client.GetFileTranslation(assetID.ToString(), languageCode);
                    Assert.Fail("A file with an invalid translation should not have been retrieved.");
                }
                catch (OnDemandClientException odce)
                {
                    Assert.AreEqual <HttpStatusCode>(HttpStatusCode.NotFound, odce.HttpStatusCode);
                    Assert.AreEqual <Int32>(0, odce.ReasonCode);
                    Assert.IsNotNull(odce.SimpleMessage);
                }

                break;
            }
        }