Ejemplo n.º 1
0
      public async Task Add_EntityHasInvalidEnumValue_IsRetrievedAsDefaultEnumValue()
      {
         var expected = new TypeWithEnumProperty
         {
            EnumProperty = (TypeWithEnumProperty.TheEnum) 10
         };
         _tableStorageProvider.Add( _tableName, expected, _partitionKey, _rowKey );
         await _tableStorageProvider.SaveAsync();

         var actual = await _tableStorageProvider.GetAsync<TypeWithEnumProperty>( _tableName, _partitionKey, _rowKey );

         Assert.AreEqual( TypeWithEnumProperty.TheEnum.FirstItem, actual.EnumProperty );
      }
Ejemplo n.º 2
0
      public async Task Add_EntityHasEnumAttribute_IsSavedAndRetrievedProperly()
      {
         var expected = new TypeWithEnumProperty { EnumProperty = TypeWithEnumProperty.TheEnum.SecondItem };
         _tableStorageProvider.Add( _tableName, expected, _partitionKey, _rowKey );
         await _tableStorageProvider.SaveAsync();

         var actual = await _tableStorageProvider.GetAsync<TypeWithEnumProperty>( _tableName, _partitionKey, _rowKey );

         Assert.AreEqual( expected.EnumProperty, actual.EnumProperty );
      }