title: Testing Firebase Classes in swift Xctest
body: <p>I am putting together an app using firebase and I want to make sure that I can run tests on it.  There isn't a lot of documentation about it - so I wanted to see if I was doing it the right way - or if I was doing it completely wrong. </p>
  
  <p>Some of the the things that don't feel right about this solution: 
  1. I am running FirApp.configure each time I spin up a new test class - isn't there a way that this can be shared? eg similar to how AppDelegate operates on an app. Currently this seems to be conflicting so the tests aren't writing anything to the DB. 
  2. I have to auth each time I do a new class - is this possible to be shared. (ie in a Pre-Setup setup file?)</p>
  
  <pre><code>import XCTest
  import Firebase
  
  @testable import BurgerRestaurant
  class BurgerTests: XCTestCase {
      var sut:Burger!
  
      override func setUp() {
          super.setUp()
          FIRApp.configure()
          self.sut = Constants.MockedObjects.testBurger
  
  
      }
  
      override func tearDown() {
          sut = nil
          super.tearDown()
      }
  
      func testSave() {
          if TestSettings.useRealFBaseCalls {
              let testSave = self.expectation(description: "Saving Burger Object")
              FIRAuth.auth()?.signIn(withEmail: TestSettings.testFireBUser, password: TestSettings.testFireBPass, completion: { (user, error) in
  
  
                  self.sut.save(completion: { 
                      testSave.fulfill()
                  })
  
              })
          }
      self.waitForExpectations(timeout: 15, handler: nil)
      }
  }
  </code></pre>
  
  <p>Ideas are welcome on how to get the testing working.</p>
  
  <p>Thanks</p>