public void SaveGet()
        {
            var random    = new Random();
            var container = new JsonContainer <Entity>(CloudStorageAccount.DevelopmentStorageAccount);

            container.EnsureExist();
            var entity = new Entity()
            {
                PartitionKey = Guid.NewGuid().ToBase64(),
                RowKey       = Guid.NewGuid().ToAscii85(),
                ToTest       = random.Next()
            };
            var id = Guid.NewGuid().ToString();

            container.Save(id, entity);

            var returned = container.Get(id);

            Assert.IsNotNull(returned);
            Assert.AreEqual <string>(entity.PartitionKey, returned.PartitionKey);
            Assert.AreEqual <string>(entity.RowKey, returned.RowKey);
            Assert.AreEqual <int>(entity.ToTest, returned.ToTest);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize
        /// </summary>
        public static void Initialize()
        {
            var account = ServerConfiguration.Default;

            var appInfo = new AzureTable <ApplicationInfoData>(account);

            appInfo.EnsureExist();

            var userApp = new AzureTable <UserApplicationData>(account);

            userApp.EnsureExist();

            var binaryEmail = new AzureTable <BinaryEmailData>(account);

            binaryEmail.EnsureExist();

            var plaintextEmail = new AzureTable <PlaintextEmailData>(account);

            plaintextEmail.EnsureExist();

            var appConfig = new AzureTable <ApplicationConfiguration>(account);

            appConfig.EnsureExist();

            var occuranceTable = new AzureTable <OccurrenceData>(account);

            occuranceTable.EnsureExist();

            var errorTable = new AzureTable <ErrorData>(account);

            errorTable.EnsureExist();

            var bytesTable = new AzureTable <BytesStoredData>(account);

            bytesTable.EnsureExist();

            var messageTable = new AzureTable <MessageData>(account);

            messageTable.EnsureExist();

            var generalMetricTable = new AzureTable <GeneralMetricRow>(account);

            generalMetricTable.EnsureExist();

            var userpreference = new AzureTable <UserPreferenceRow>(account);

            userpreference.EnsureExist();

            var company = new AzureTable <CompanyRow>(account);

            company.EnsureExist();

            var contact = new AzureTable <ContactRow>(account);

            contact.EnsureExist();

            var contactGroup = new AzureTable <ContactGroupRow>(account);

            contactGroup.EnsureExist();

            var userTable = new AzureTable <UserData>(account);

            userTable.EnsureExist();

            var roleTable = new AzureTable <RoleRow>(account);

            roleTable.EnsureExist();

            var eventLog = new AzureTable <EventLogRow>(account);

            eventLog.EnsureExist();

            var paypal = new AzureTable <PayPalPaymentConfirmationRow>(account);

            paypal.EnsureExist();

            var serverStats = new AzureTable <ServerStatisticsRow>(account);

            serverStats.EnsureExist();

            var blog = new AzureTable <BlogRow>(account);

            blog.EnsureExist();

            var latestServerStats = new AzureTable <LatestServerStatisticsRow>(account);

            latestServerStats.EnsureExist();

            var logHistory = new JsonContainer <LogHistory <LogItem> >(account);

            logHistory.EnsureExist();

            var userProfile = new AzureTable <UserProfileRow>(account);

            userProfile.EnsureExist();

            var dataManagerLog = new AzureTable <DataManagerLog>(account);

            dataManagerLog.EnsureExist();

            var userTribesRow = new AzureTable <UserTribesRow>(account);

            userTribesRow.EnsureExist();
        }